Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2010-06-29 18:52:47 -0400
committereutarass2010-06-29 18:52:47 -0400
commitcbe8221347cbc231468f57a9e2a4ff42d4087a10 (patch)
tree9e78ae02c86244e1a20132bbf98fcdfc05363a61 /plugins/org.eclipse.tm.tcf.debug
parentff36bd97c48081d1e568de58bb6bc64bdddceb6a (diff)
downloadorg.eclipse.tcf-cbe8221347cbc231468f57a9e2a4ff42d4087a10.tar.gz
org.eclipse.tcf-cbe8221347cbc231468f57a9e2a4ff42d4087a10.tar.xz
org.eclipse.tcf-cbe8221347cbc231468f57a9e2a4ff42d4087a10.zip
Added support for "step into range" run control commands in both the agent and the debugger
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepInto.java49
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepOver.java14
2 files changed, 42 insertions, 21 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepInto.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepInto.java
index 83ba8aa79..0a9689628 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepInto.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepInto.java
@@ -11,6 +11,7 @@
package org.eclipse.tm.internal.tcf.debug.actions;
import java.math.BigInteger;
+import java.util.HashMap;
import java.util.Map;
import org.eclipse.tm.internal.tcf.debug.model.TCFContextState;
@@ -20,7 +21,6 @@ import org.eclipse.tm.tcf.protocol.IToken;
import org.eclipse.tm.tcf.protocol.Protocol;
import org.eclipse.tm.tcf.services.ILineNumbers;
import org.eclipse.tm.tcf.services.IRunControl;
-import org.eclipse.tm.tcf.services.IStackTrace;
import org.eclipse.tm.tcf.services.IRunControl.RunControlContext;
import org.eclipse.tm.tcf.util.TCFDataCache;
@@ -48,7 +48,6 @@ public abstract class TCFActionStepInto extends TCFAction implements IRunControl
protected abstract TCFDataCache<TCFContextState> getContextState();
protected abstract TCFDataCache<TCFSourceRef> getLineInfo();
protected abstract TCFDataCache<?> getStackTrace();
- protected abstract TCFDataCache<IStackTrace.StackTraceContext> getStackFrame();
protected abstract int getStackFrameIndex();
public void run() {
@@ -123,11 +122,8 @@ public abstract class TCFActionStepInto extends TCFAction implements IRunControl
exit(null);
return;
}
+ BigInteger pc = new BigInteger(state.getData().suspend_pc);
if (step_cnt > 0) {
- TCFDataCache<IStackTrace.StackTraceContext> frame = getStackFrame();
- if (!frame.validate(this)) return;
- Number addr = frame.getData().getInstructionAddress();
- BigInteger pc = addr instanceof BigInteger ? (BigInteger)addr : new BigInteger(addr.toString());
if (pc == null || pc0 == null || pc1 == null) {
exit(null);
return;
@@ -135,24 +131,37 @@ public abstract class TCFActionStepInto extends TCFAction implements IRunControl
if (pc.compareTo(pc0) < 0 || pc.compareTo(pc1) >= 0) {
if (!line_info.validate(this)) return;
TCFSourceRef ref = line_info.getData();
- if (ref != null && ref.area != null) {
- if (isSameLine(source_ref.area, ref.area)) {
- source_ref = ref;
- ILineNumbers.CodeArea area = source_ref.area;
- if (area.start_address instanceof BigInteger) pc0 = (BigInteger)area.start_address;
- else if (area.start_address != null) pc0 = new BigInteger(area.start_address.toString());
- if (area.end_address instanceof BigInteger) pc1 = (BigInteger)area.end_address;
- else if (area.end_address != null) pc1 = new BigInteger(area.end_address.toString());
- }
- else {
- exit(null);
- return;
- }
+ if (ref == null || ref.area == null) {
+ // No line info for current PC, continue stepping
+ }
+ else if (isSameLine(source_ref.area, ref.area)) {
+ source_ref = ref;
+ ILineNumbers.CodeArea area = source_ref.area;
+ if (area.start_address instanceof BigInteger) pc0 = (BigInteger)area.start_address;
+ else if (area.start_address != null) pc0 = new BigInteger(area.start_address.toString());
+ if (area.end_address instanceof BigInteger) pc1 = (BigInteger)area.end_address;
+ else if (area.end_address != null) pc1 = new BigInteger(area.end_address.toString());
+ }
+ else {
+ exit(null);
+ return;
}
}
}
step_cnt++;
- if (ctx.canResume(IRunControl.RM_STEP_INTO)) {
+ if (ctx.canResume(IRunControl.RM_STEP_INTO_RANGE) &&
+ pc != null && pc0 != null && pc1 != null &&
+ pc.compareTo(pc0) >= 0 && pc.compareTo(pc1) < 0) {
+ HashMap<String,Object> args = new HashMap<String,Object>();
+ args.put(IRunControl.RP_RANGE_START, pc0);
+ args.put(IRunControl.RP_RANGE_END, pc1);
+ ctx.resume(IRunControl.RM_STEP_INTO_RANGE, 1, args, new IRunControl.DoneCommand() {
+ public void doneCommand(IToken token, Exception error) {
+ if (error != null) exit(error);
+ }
+ });
+ }
+ else if (ctx.canResume(IRunControl.RM_STEP_INTO)) {
ctx.resume(IRunControl.RM_STEP_INTO, 1, new IRunControl.DoneCommand() {
public void doneCommand(IToken token, Exception error) {
if (error != null) exit(error);
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepOver.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepOver.java
index ba60c4318..40141fb37 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepOver.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/actions/TCFActionStepOver.java
@@ -164,13 +164,13 @@ public abstract class TCFActionStepOver extends TCFAction implements IRunControl
});
bp = null;
}
+ BigInteger pc = new BigInteger(state.getData().suspend_pc);
if (step_cnt > 0) {
if (pc0 == null && pc1 == null || state.getData().suspend_pc == null) {
exit(null);
return;
}
assert src_step;
- BigInteger pc = new BigInteger(state.getData().suspend_pc);
if (pc.compareTo(pc0) < 0 || pc.compareTo(pc1) >= 0) {
if (!line_info.validate(this)) return;
TCFSourceRef ref = line_info.getData();
@@ -203,6 +203,18 @@ public abstract class TCFActionStepOver extends TCFAction implements IRunControl
}
});
}
+ else if (ctx.canResume(IRunControl.RM_STEP_INTO_RANGE) &&
+ pc != null && pc0 != null && pc1 != null &&
+ pc.compareTo(pc0) >= 0 && pc.compareTo(pc1) < 0) {
+ HashMap<String,Object> args = new HashMap<String,Object>();
+ args.put(IRunControl.RP_RANGE_START, pc0);
+ args.put(IRunControl.RP_RANGE_END, pc1);
+ ctx.resume(IRunControl.RM_STEP_INTO_RANGE, 1, args, new IRunControl.DoneCommand() {
+ public void doneCommand(IToken token, Exception error) {
+ if (error != null) exit(error);
+ }
+ });
+ }
else if (ctx.canResume(IRunControl.RM_STEP_INTO)) {
ctx.resume(IRunControl.RM_STEP_INTO, 1, new IRunControl.DoneCommand() {
public void doneCommand(IToken token, Exception error) {

Back to the top