Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java2
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java34
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java2
3 files changed, 30 insertions, 8 deletions
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java
index 02f8e5397..65a33225f 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/RunControl.java
@@ -79,7 +79,7 @@ class RunControl {
}
public void contextSuspended(final String id, String pc, String reason, Map<String,Object> params) {
- if (enable_trace) System.out.println("" + channel_id + " suspended " + id);
+ if (enable_trace) System.out.println("" + channel_id + " suspended " + id + ": " + pc + " " + reason);
suspended_ctx_ids.add(id);
Protocol.invokeLater(new Runnable() {
public void run() {
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java
index e6683ff9a..06d77453e 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestExpressions.java
@@ -471,16 +471,36 @@ class TestExpressions implements ITCFTest, RunControl.DiagnosticTestDone,
}
assert test_done || !canResume(thread_id);
if (stack_trace == null) {
- srv_stk.getChildren(thread_id, new IStackTrace.DoneGetChildren() {
+ srv_stk.getChildrenRange(thread_id, 0, 5, new IStackTrace.DoneGetChildren() {
public void doneGetChildren(IToken token, Exception error, String[] context_ids) {
- if (error != null) {
+ if (error instanceof IErrorReport && ((IErrorReport)error).getErrorCode() == IErrorReport.TCF_ERROR_INV_COMMAND) {
+ /* Older agent, the command not available */
+ srv_stk.getChildren(thread_id, new IStackTrace.DoneGetChildren() {
+ public void doneGetChildren(IToken token, Exception error, String[] context_ids) {
+ if (error != null) {
+ exit(error);
+ }
+ else if (context_ids == null || context_ids.length < 2) {
+ exit(new Exception("Invalid stack trace"));
+ }
+ else {
+ stack_trace = context_ids;
+ runTest();
+ }
+ }
+ });
+ }
+ else if (error != null) {
exit(error);
}
else if (context_ids == null || context_ids.length < 2) {
exit(new Exception("Invalid stack trace"));
}
else {
- stack_trace = context_ids;
+ stack_trace = new String[context_ids.length];
+ for (int i = 0; i < context_ids.length; i++) {
+ stack_trace[context_ids.length - i - 1] = context_ids[i];
+ }
runTest();
}
}
@@ -506,18 +526,18 @@ class TestExpressions implements ITCFTest, RunControl.DiagnosticTestDone,
int j = stack_trace.length - i - 2;
if (i >= context_ids.length) {
if (j >= 0) {
- exit(new Exception("Invalid result of doneGetChildren command: too short"));
+ exit(new Exception("Invalid result of getChildrenRange command: too short"));
}
}
else {
if (j < 0) {
- exit(new Exception("Invalid result of doneGetChildren command: too long"));
+ exit(new Exception("Invalid result of getChildrenRange command: too long"));
}
if (context_ids[i]== null) {
- exit(new Exception("Invalid result of doneGetChildren command: ID is null"));
+ exit(new Exception("Invalid result of getChildrenRange command: ID is null"));
}
if (!context_ids[i].equals(stack_trace[j])) {
- exit(new Exception("Invalid result of doneGetChildren command: wrong ID"));
+ exit(new Exception("Invalid result of getChildrenRange command: wrong ID"));
}
}
}
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java
index 292878151..d1f18d090 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java
@@ -1475,7 +1475,9 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl.
if (isMyBreakpoint(sc)) {
rm = rnd.nextInt(6);
if (!ctx.canResume(rm)) rm = IRunControl.RM_RESUME;
+ /* TODO: a better way to test step counter
if (rm != IRunControl.RM_RESUME) cnt = rnd.nextInt(5) + 1;
+ */
}
test_rc.resume(id, rm, cnt);
}

Back to the top