Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2010-04-01 18:52:37 -0400
committereutarass2010-04-01 18:52:37 -0400
commit7b7defd6df9f7667c2be3dbe9383555adf68eab7 (patch)
tree36dbeecf39a9b03041c863419d84e52dce1fe47f /plugins
parentcbdc871ff548ea8a3d621df964f00bf350a2c62a (diff)
downloadorg.eclipse.tcf-7b7defd6df9f7667c2be3dbe9383555adf68eab7.tar.gz
org.eclipse.tcf-7b7defd6df9f7667c2be3dbe9383555adf68eab7.tar.xz
org.eclipse.tcf-7b7defd6df9f7667c2be3dbe9383555adf68eab7.zip
TCF Debugger: improved implementation of fake top stack frame node that is used when real stack trace is not available
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenLocalVariables.java6
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java1
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java12
4 files changed, 17 insertions, 6 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenLocalVariables.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenLocalVariables.java
index 2ed374b70..6b109583c 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenLocalVariables.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenLocalVariables.java
@@ -18,9 +18,9 @@ import org.eclipse.tm.tcf.services.IExpressions;
public class TCFChildrenLocalVariables extends TCFChildren {
- private final TCFNode node;
+ private final TCFNodeStackFrame node;
- TCFChildrenLocalVariables(TCFNode node) {
+ TCFChildrenLocalVariables(TCFNodeStackFrame node) {
super(node.channel, 128);
this.node = node;
}
@@ -33,7 +33,7 @@ public class TCFChildrenLocalVariables extends TCFChildren {
@Override
protected boolean startDataRetrieval() {
IExpressions exps = node.model.getLaunch().getService(IExpressions.class);
- if (exps == null) {
+ if (exps == null || node.isEmulated()) {
set(null, null, new HashMap<String,TCFNode>());
return true;
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java
index b37bf6aa1..12a0fb71e 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenStackTrace.java
@@ -75,7 +75,7 @@ public class TCFChildrenStackTrace extends TCFChildren {
private void addEmulatedTopFrame(HashMap<String,TCFNode> data) {
top_frame_id = node.id + "-TF";
TCFNodeStackFrame n = (TCFNodeStackFrame)node.model.getNode(top_frame_id);
- if (n == null) n = new TCFNodeStackFrame(node, top_frame_id);
+ if (n == null) n = new TCFNodeStackFrame(node, top_frame_id, true);
data.put(n.id, n);
}
@@ -105,7 +105,7 @@ public class TCFChildrenStackTrace extends TCFChildren {
for (String id : contexts) {
cnt--;
TCFNodeStackFrame n = (TCFNodeStackFrame)node.model.getNode(id);
- if (n == null) n = new TCFNodeStackFrame(node, id);
+ if (n == null) n = new TCFNodeStackFrame(node, id, false);
assert n.parent == node;
n.setFrameNo(cnt);
data.put(id, n);
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java
index 2dcffc178..d080131c6 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java
@@ -199,6 +199,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
if (cast != null) e = "(" + cast + ")(" + e + ")";
TCFNode n = parent;
while (n instanceof TCFNodeExpression || n instanceof TCFNodeArrayPartition) n = n.parent;
+ if (n instanceof TCFNodeStackFrame && ((TCFNodeStackFrame)n).isEmulated()) n = n.parent;
command = exps.create(n.id, null, e, new IExpressions.DoneCreate() {
public void doneCreate(IToken token, Exception error, IExpressions.Expression context) {
Expression e = null;
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
index ba0e6a62e..d137d1144 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
@@ -35,6 +35,7 @@ import org.eclipse.tm.tcf.util.TCFDataCache;
public class TCFNodeStackFrame extends TCFNode {
private int frame_no;
+ private final boolean emulated;
private final TCFChildrenRegisters children_regs;
private final TCFChildrenLocalVariables children_vars;
private final TCFChildrenExpressions children_exps;
@@ -42,8 +43,9 @@ public class TCFNodeStackFrame extends TCFNode {
private final TCFDataCache<TCFSourceRef> line_info;
private final TCFDataCache<BigInteger> address;
- TCFNodeStackFrame(final TCFNodeExecContext parent, final String id) {
+ TCFNodeStackFrame(final TCFNodeExecContext parent, final String id, final boolean emulated) {
super(parent, id);
+ this.emulated = emulated;
children_regs = new TCFChildrenRegisters(this);
children_vars = new TCFChildrenLocalVariables(this);
children_exps = new TCFChildrenExpressions(this);
@@ -51,6 +53,10 @@ public class TCFNodeStackFrame extends TCFNode {
@Override
protected boolean startDataRetrieval() {
assert command == null;
+ if (emulated) {
+ set(null, null, null);
+ return true;
+ }
TCFDataCache<TCFContextState> parent_state_cache = parent.getState();
if (!parent_state_cache.validate(this)) return false;
TCFContextState parent_state_data = parent_state_cache.getData();
@@ -216,6 +222,10 @@ public class TCFNodeStackFrame extends TCFNode {
return null;
}
+ public boolean isEmulated() {
+ return emulated;
+ }
+
private TCFChildren getChildren(IPresentationContext ctx) {
String id = ctx.getId();
if (IDebugUIConstants.ID_REGISTER_VIEW.equals(id)) return children_regs;

Back to the top