Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2021-05-25 13:09:17 -0400
committerEugene Tarassov2021-05-25 13:09:17 -0400
commitde771e84782677c7953a39b907d607754b2c33a5 (patch)
treee09227bfb5c69c8430cdd8ef04e0378c6cbb2aca
parent69a34739b5e40754fe9bd379ebc7f70fa244abb5 (diff)
downloadorg.eclipse.tcf-de771e84782677c7953a39b907d607754b2c33a5.tar.gz
org.eclipse.tcf-de771e84782677c7953a39b907d607754b2c33a5.tar.xz
org.eclipse.tcf-de771e84782677c7953a39b907d607754b2c33a5.zip
Bug 568689 - On-demand RunControl.getState from Eclipse
Added RunControl.getMinState, which does not include PC. Replaced getState with getMinState where PC is not needed. If target does not support getMinState, it falls back to getState. Signed-off-by: Eugene Tarassov <eugenet@xilinx.com>
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/commands/TCFStepIntoSelectionHandler.java2
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java22
-rw-r--r--plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java24
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java4
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/DropToFrameCommand.java8
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenStackTrace.java18
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java39
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelSelectionPolicy.java2
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java85
9 files changed, 152 insertions, 52 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/commands/TCFStepIntoSelectionHandler.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/commands/TCFStepIntoSelectionHandler.java
index f1a40b2b8..2b2e7b99b 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/commands/TCFStepIntoSelectionHandler.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/commands/TCFStepIntoSelectionHandler.java
@@ -60,7 +60,7 @@ public class TCFStepIntoSelectionHandler implements IDebugCommandHandler {
done(null, false);
return;
}
- TCFDataCache<TCFContextState> cache = l.node.getState();
+ TCFDataCache<TCFContextState> cache = l.node.getMinState();
if (!cache.validate(this)) return;
if (cache.getError() != null) {
done(cache.getError(), false);
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java
index 7b1805fe6..002d55d3c 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/internal/services/remote/RunControlProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2021 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -142,6 +142,26 @@ public class RunControlProxy implements IRunControl {
}.token;
}
+ public IToken getMinState(final DoneGetMinState done) {
+ return new Command(channel, RunControlProxy.this, "getMinState", new Object[]{ getID() }) {
+ @SuppressWarnings("unchecked")
+ @Override
+ public void done(Exception error, Object[] args) {
+ boolean susp = false;
+ String reason = null;
+ Map<String,Object> map = null;
+ if (error == null) {
+ assert args.length == 4;
+ error = toError(args[0]);
+ susp = ((Boolean)args[1]).booleanValue();
+ reason = (String)args[2];
+ map = (Map<String,Object>)args[3];
+ }
+ done.doneGetMinState(token, error, susp, reason, map);
+ }
+ }.token;
+ }
+
public IToken resume(int mode, int count, DoneCommand done) {
return command("resume", new Object[]{ getID(), mode, count }, done);
}
diff --git a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java
index 2ed9249fa..2d2201da9 100644
--- a/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java
+++ b/plugins/org.eclipse.tcf.core/src/org/eclipse/tcf/services/IRunControl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2019 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2021 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -544,6 +544,15 @@ public interface IRunControl extends IService {
IToken getState(DoneGetState done);
/**
+ * Send a command to retrieve current state of a context.
+ * Similar to getState, but does not retrieve PC.
+ * With some targets, it can be substantially faster.
+ * @param done - command result call back object.
+ * @return pending command handle, can be used to cancel the command.
+ */
+ IToken getMinState(DoneGetMinState done);
+
+ /**
* Send a command to suspend a context.
* Also suspends children if context is a container.
* @param done - command result call back object.
@@ -601,6 +610,19 @@ public interface IRunControl extends IService {
String reason, Map<String,Object> params);
}
+ interface DoneGetMinState {
+ /**
+ * Called when getMinState command execution is complete.
+ * @param token - pending command handle.
+ * @param error - command execution error or null.
+ * @param suspended - true if the context is suspended
+ * @param reason - suspend reason (if suspended), see REASON_*.
+ * @param params - additional target specific data about context state, see STATE_*.
+ */
+ void doneGetMinState(IToken token, Exception error, boolean suspended,
+ String reason, Map<String,Object> params);
+ }
+
interface DoneCommand {
/**
* Called when run control command execution is complete.
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java
index 0ac6e002b..68512756f 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011-2021 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -278,7 +278,7 @@ public class TCFNodePropertySource implements IPropertySource {
addDescriptor("State", "Suspended", state.is_suspended);
if (state.suspend_reason != null) addDescriptor("State", "Suspend reason", state.suspend_reason);
if (state.suspend_pc != null) addDescriptor("State", "PC", toHexAddrString(new BigInteger(state.suspend_pc)));
- addDescriptor("State", "Active", !exe_node.isNotActive());
+ addDescriptor("State", "Active", !state.isNotActive());
if (state.suspend_params != null) {
for (String key : state.suspend_params.keySet()) {
Object value = state.suspend_params.get(key);
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/DropToFrameCommand.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/DropToFrameCommand.java
index 8b2a8c88f..0d8ce0f4e 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/DropToFrameCommand.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/DropToFrameCommand.java
@@ -71,10 +71,8 @@ public class DropToFrameCommand implements IDropToFrameHandler {
done();
return;
}
- TCFDataCache<TCFContextState> state_cache = exe_node.getState();
- if (!state_cache.validate(this)) {
- return;
- }
+ TCFDataCache<TCFContextState> state_cache = exe_node.getMinState();
+ if (!state_cache.validate(this)) return;
TCFContextState state_data = state_cache.getData();
request.setEnabled(state_data != null && state_data.is_suspended);
done();
@@ -110,7 +108,7 @@ public class DropToFrameCommand implements IDropToFrameHandler {
}
TCFDataCache<IRunControl.RunControlContext> ctx_cache = exe_node.getRunContext();
if (!ctx_cache.validate(this)) return;
- TCFDataCache<TCFContextState> state_cache = exe_node.getState();
+ TCFDataCache<TCFContextState> state_cache = exe_node.getMinState();
if (!state_cache.validate(this)) return;
TCFContextState state_data = state_cache.getData();
if (state_data == null || !state_data.is_suspended) {
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenStackTrace.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenStackTrace.java
index fcfa6464b..950356ffb 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenStackTrace.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFChildrenStackTrace.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2021 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -27,7 +27,6 @@ public class TCFChildrenStackTrace extends TCFChildren {
private String top_frame_id;
private int limit_factor = 1;
- private boolean incremental_trace_not_supported;
TCFChildrenStackTrace(TCFNodeExecContext node) {
super(node, 16);
@@ -83,12 +82,13 @@ public class TCFChildrenStackTrace extends TCFChildren {
}
Boolean checkHasChildren(Runnable done) {
- TCFDataCache<TCFContextState> state = node.getState();
+ TCFDataCache<TCFContextState> state = node.getMinState();
if (!state.validate(done)) return null;
- if (node.isNotActive()) return false;
if (state.getError() != null) return false;
TCFContextState state_data = state.getData();
- if (state_data == null || !state_data.is_suspended) return false;
+ if (state_data == null) return false;
+ if (!state_data.is_suspended) return false;
+ if (state_data.isNotActive()) return false;
return true;
}
@@ -154,7 +154,7 @@ public class TCFChildrenStackTrace extends TCFChildren {
public void doneGetChildren(IToken token, Exception error, String[] contexts) {
if (command == token) {
if (error instanceof IErrorReport && ((IErrorReport)error).getErrorCode() == IErrorReport.TCF_ERROR_INV_COMMAND) {
- incremental_trace_not_supported = true;
+ node.model.no_incremental_trace = true;
runCompleteStackTrace(data);
return;
}
@@ -185,7 +185,9 @@ public class TCFChildrenStackTrace extends TCFChildren {
final HashMap<String,TCFNode> data = new HashMap<String,TCFNode>();
if (!has_children) {
top_frame_id = null;
- set(null, node.getState().getError(), data);
+ TCFDataCache<TCFContextState> state = node.getMinState();
+ if (!state.validate(this)) return false;
+ set(null, state.getError(), data);
return true;
}
if (service == null) {
@@ -194,7 +196,7 @@ public class TCFChildrenStackTrace extends TCFChildren {
return true;
}
assert command == null;
- if (incremental_trace_not_supported || !node.model.getStackFramesLimitEnabled()) {
+ if (node.model.no_incremental_trace || !node.model.getStackFramesLimitEnabled()) {
runCompleteStackTrace(data);
}
else {
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index 6a8eced48..ed8b609c5 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2020 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2021 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -170,6 +170,9 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
UPDATE_POLICY_MANUAL = 1,
UPDATE_POLICY_BREAKPOINT = 2;
+ boolean no_incremental_trace;
+ boolean no_min_state;
+
/**
* A dummy editor input to open the disassembly view as editor.
*/
@@ -704,7 +707,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
else {
boolean node_selected = false;
for (TCFNodeExecContext n : nodes) {
- String reason = n.getState().getData().suspend_reason;
+ String reason = n.getMinState().getData().suspend_reason;
node_selected |= setDebugViewSelectionForProxy(proxy, n, reason);
}
if (!node_selected) {
@@ -742,7 +745,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
if (!run_context.validate(this)) return false;
IRunControl.RunControlContext ctx = run_context.getData();
if (ctx != null && ctx.hasState()) {
- TCFDataCache<TCFContextState> state = n.getState();
+ TCFDataCache<TCFContextState> state = n.getMinState();
if (!state.validate(this)) return false;
TCFContextState s = state.getData();
if (s != null && s.is_suspended) nodes.add(n);
@@ -1951,15 +1954,13 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
if (element instanceof TCFNodeExecContext) {
TCFNodeExecContext exec_ctx = (TCFNodeExecContext)element;
if (!exec_ctx.isDisposed() && active_actions.get(exec_ctx.id) == null) {
- TCFDataCache<TCFContextState> state_cache = exec_ctx.getState();
+ TCFDataCache<TCFContextState> state_cache = exec_ctx.getMinState();
if (!state_cache.validate(this)) return;
- if (!exec_ctx.isNotActive()) {
- TCFContextState state_data = state_cache.getData();
- if (state_data != null && state_data.is_suspended) {
- TCFChildrenStackTrace stack_trace = exec_ctx.getStackTrace();
- if (!stack_trace.validate(this)) return;
- stack_frame = stack_trace.getTopFrame();
- }
+ TCFContextState state_data = state_cache.getData();
+ if (state_data != null && state_data.is_suspended && !state_data.isNotActive()) {
+ TCFChildrenStackTrace stack_trace = exec_ctx.getStackTrace();
+ if (!stack_trace.validate(this)) return;
+ stack_frame = stack_trace.getTopFrame();
}
}
}
@@ -1967,16 +1968,14 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
TCFNodeStackFrame f = (TCFNodeStackFrame)element;
TCFNodeExecContext exec_ctx = (TCFNodeExecContext)f.parent;
if (!f.isDisposed() && !exec_ctx.isDisposed() && active_actions.get(exec_ctx.id) == null) {
- TCFDataCache<TCFContextState> state_cache = exec_ctx.getState();
+ TCFDataCache<TCFContextState> state_cache = exec_ctx.getMinState();
if (!state_cache.validate(this)) return;
- if (!exec_ctx.isNotActive()) {
- TCFContextState state_data = state_cache.getData();
- if (state_data != null && state_data.is_suspended) {
- // Validate stack trace to make sure stack_frame.getFrameNo() is valid
- TCFChildrenStackTrace stack_trace = exec_ctx.getStackTrace();
- if (!stack_trace.validate(this)) return;
- stack_frame = f;
- }
+ TCFContextState state_data = state_cache.getData();
+ if (state_data != null && state_data.is_suspended && !state_data.isNotActive()) {
+ // Validate stack trace to make sure stack_frame.getFrameNo() is valid
+ TCFChildrenStackTrace stack_trace = exec_ctx.getStackTrace();
+ if (!stack_trace.validate(this)) return;
+ stack_frame = f;
}
}
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelSelectionPolicy.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelSelectionPolicy.java
index ff5a9a5fc..c6c01e772 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelSelectionPolicy.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelSelectionPolicy.java
@@ -62,7 +62,7 @@ class TCFModelSelectionPolicy implements IModelSelectionPolicy {
TCFNode n = node;
while (n != null && !n.isDisposed()) {
if (n instanceof TCFNodeExecContext) {
- TCFDataCache<TCFContextState> cache = ((TCFNodeExecContext)n).getState();
+ TCFDataCache<TCFContextState> cache = ((TCFNodeExecContext)n).getMinState();
if (!cache.validate(this)) return;
TCFContextState state = cache.getData();
if (state != null && state.is_suspended) {
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java
index 8468304b4..171c46d8b 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExecContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2019 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2021 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -43,6 +43,7 @@ import org.eclipse.tcf.internal.debug.model.TCFSourceRef;
import org.eclipse.tcf.internal.debug.model.TCFSymFileRef;
import org.eclipse.tcf.internal.debug.ui.ColorCache;
import org.eclipse.tcf.internal.debug.ui.ImageCache;
+import org.eclipse.tcf.protocol.IErrorReport;
import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.protocol.JSON;
import org.eclipse.tcf.protocol.Protocol;
@@ -72,6 +73,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
private final TCFData<MemoryRegion[]> memory_map;
private final TCFData<IProcesses.ProcessContext> prs_context;
private final TCFData<TCFContextState> state;
+ private final TCFData<TCFContextState> min_state;
private final TCFData<BigInteger> address; // Current PC as BigInteger
private final TCFData<Collection<Map<String,Object>>> signal_list;
private final TCFData<SignalMask[]> signal_mask;
@@ -346,6 +348,48 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
return false;
}
};
+ min_state = new TCFData<TCFContextState>(channel) {
+ @Override
+ protected boolean startDataRetrieval() {
+ assert command == null;
+ if (!run_context.validate(this)) return false;
+ IRunControl.RunControlContext ctx = run_context.getData();
+ if (ctx == null || !ctx.hasState()) {
+ set(null, null, null);
+ return true;
+ }
+ if (model.no_min_state || state.isValid()) {
+ if (!state.validate(this)) return false;
+ Throwable e = state.getError();
+ TCFContextState s = state.getData();
+ TCFContextState m = null;
+ if (s != null) {
+ m = new TCFContextState();
+ m.is_suspended = s.is_suspended;
+ m.suspend_reason = s.suspend_reason;
+ m.suspend_params = s.suspend_params;
+ }
+ set(null, e, m);
+ return true;
+ }
+ command = ctx.getMinState(new IRunControl.DoneGetMinState() {
+ public void doneGetMinState(IToken token, Exception error, boolean suspended, String reason, Map<String,Object> params) {
+ if (error instanceof IErrorReport && ((IErrorReport)error).getErrorCode() == IErrorReport.TCF_ERROR_INV_COMMAND) {
+ model.no_min_state = true;
+ command = null;
+ validate();
+ return;
+ }
+ TCFContextState m = new TCFContextState();
+ m.is_suspended = suspended;
+ m.suspend_reason = reason;
+ m.suspend_params = params;
+ set(token, error, m);
+ }
+ });
+ return false;
+ }
+ };
address = new TCFData<BigInteger>(channel) {
@Override
protected boolean startDataRetrieval() {
@@ -822,6 +866,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
return state;
}
+ public TCFDataCache<TCFContextState> getMinState() {
+ return min_state;
+ }
+
public TCFChildrenStackTrace getStackTrace() {
return children_stack;
}
@@ -905,8 +953,9 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
private boolean okToHideStack() {
TCFAction action = model.getActiveAction(id);
if (action != null && action.showRunning()) return true;
- TCFContextState state_data = state.getData();
+ TCFContextState state_data = min_state.getData();
if (state_data == null) return true;
+ assert state_data.suspend_pc == null;
if (!state_data.is_suspended) return true;
if (state_data.isNotActive()) return true;
return false;
@@ -924,7 +973,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
result.setChildCount(last_stack_trace.length);
return true;
}
- if (!state.validate(done)) return false;
+ if (!min_state.validate(done)) return false;
if (okToHideStack()) {
last_stack_trace = empty_node_array;
result.setChildCount(0);
@@ -998,7 +1047,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
setResultChildren(result, last_stack_trace);
return true;
}
- if (!state.validate(done)) return false;
+ if (!min_state.validate(done)) return false;
if (okToHideStack()) {
last_stack_trace = empty_node_array;
return true;
@@ -1062,7 +1111,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
result.setHasChilren(last_stack_trace.length > 0);
return true;
}
- if (!state.validate(done)) return false;
+ if (!min_state.validate(done)) return false;
if (okToHideStack()) {
last_stack_trace = empty_node_array;
result.setHasChilren(false);
@@ -1192,8 +1241,8 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
image_name = ImageCache.IMG_THREAD_RUNNNIG;
}
else {
- if (!state.validate(done)) return false;
- TCFContextState state_data = state.getData();
+ if (!min_state.validate(done)) return false;
+ TCFContextState state_data = min_state.getData();
image_name = ImageCache.IMG_THREAD_UNKNOWN_STATE;
if (state_data != null) {
if (!state_data.is_suspended) {
@@ -1216,9 +1265,9 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
return true;
}
else {
- if (!state.validate(done)) return false;
- TCFContextState state_data = state.getData();
- if (isNotActive()) {
+ if (!min_state.validate(done)) return false;
+ TCFContextState state_data = min_state.getData();
+ if (state_data != null && state_data.isNotActive()) {
image_name = ImageCache.IMG_THREAD_NOT_ACTIVE;
label.append(" (Not active)");
if (state_data.suspend_reason != null && !state_data.suspend_reason.equals(IRunControl.REASON_USER_REQUEST)) {
@@ -1509,6 +1558,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
TCFContextState s = state.getData();
if (s == null || s.is_suspended) state.reset();
}
+ if (min_state.isValid()) {
+ TCFContextState s = min_state.getData();
+ if (s == null || s.is_suspended) min_state.reset();
+ }
children_stack.reset();
children_stack.onSourceMappingChange();
children_regs.reset();
@@ -1580,6 +1633,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
else {
state.reset();
}
+ min_state.reset();
address.reset();
signal_mask.reset();
children_stack.onSuspended(func_call);
@@ -1616,6 +1670,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
void onContextResumed() {
assert !isDisposed();
state.reset();
+ min_state.reset();
if (!resume_pending) {
final int cnt = ++resumed_cnt;
resume_pending = true;
@@ -1636,11 +1691,11 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
void onContextStateChanged() {
assert !isDisposed();
state.reset();
+ min_state.reset();
postStateChangedDelta();
}
void onContextActionDone() {
- assert state.isValid();
if (state.getData() == null || state.getData().is_suspended) {
resumed_cnt++;
resume_pending = false;
@@ -1693,6 +1748,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
TCFContextState s = state.getData();
if (s == null || s.is_suspended) state.reset();
}
+ if (min_state.isValid()) {
+ TCFContextState s = min_state.getData();
+ if (s == null || s.is_suspended) min_state.reset();
+ }
address.reset();
children_stack.onRegisterValueChanged();
children_exps.onRegisterValueChanged();
@@ -1759,14 +1818,14 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner, ITCFExe
if (!e.run_context.validate(done)) return false;
IRunControl.RunControlContext ctx = e.run_context.getData();
if (ctx != null && ctx.hasState()) {
- TCFDataCache<TCFContextState> state_cache = e.getState();
+ TCFDataCache<TCFContextState> state_cache = e.getMinState();
if (!state_cache.validate(done)) return false;
TCFContextState state_data = state_cache.getData();
if (state_data != null) {
if (!state_data.is_suspended) {
info.running = true;
}
- else if (e.isNotActive()) {
+ else if (state_data.isNotActive()) {
info.not_active = true;
}
else {

Back to the top