Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2010-04-30 16:24:03 -0400
committereutarass2010-04-30 16:24:03 -0400
commitb6a48dc562c3844a3dfab0c362c8bd103c2d2fee (patch)
treeb858a17c8a1022fa2b9ab2f333a74914c66ba54a /plugins/org.eclipse.tm.tcf.debug
parent5a277bfafe0da72d9a962bd0dbc54c0d72429511 (diff)
downloadorg.eclipse.tcf-b6a48dc562c3844a3dfab0c362c8bd103c2d2fee.tar.gz
org.eclipse.tcf-b6a48dc562c3844a3dfab0c362c8bd103c2d2fee.tar.xz
org.eclipse.tcf-b6a48dc562c3844a3dfab0c362c8bd103c2d2fee.zip
TCF Agent: in order to improve debug API abstraction:
1. removed "pid_t pid" and "pid_t mem" fields from "struct Context": usage of pid_t is not 100% portable, some contexts might not have a PID. 2. added "char id[]" field in "struct Context". The field contains TCF ID of the context. 3. added "Context * mem" field in "struct Context". The field points to memory space object of the context. 4. added "Context * creator" field in "struct Context".
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/tests/TestExpressions.java30
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java2
2 files changed, 29 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestExpressions.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestExpressions.java
index 58d7075bd..5b1cdb6c2 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestExpressions.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestExpressions.java
@@ -40,9 +40,11 @@ class TestExpressions implements ITCFTest,
private String bp_id;
private boolean bp_ok;
private IDiagnostics.ISymbol sym_func3;
+ private String test_ctx_id;
private String process_id;
private String thread_id;
private boolean test_done;
+ private IRunControl.RunControlContext test_ctx;
private IRunControl.RunControlContext thread_ctx;
private String suspended_pc;
private boolean waiting_suspend;
@@ -181,14 +183,35 @@ class TestExpressions implements ITCFTest,
});
return;
}
- if (process_id == null) {
+ if (test_ctx_id == null) {
diag.runTest("RCBP1", new IDiagnostics.DoneRunTest() {
public void doneRunTest(IToken token, Throwable error, String id) {
if (error != null) {
exit(error);
}
else {
- process_id = id;
+ test_ctx_id = id;
+ runTest();
+ }
+ }
+ });
+ return;
+ }
+ if (test_ctx == null) {
+ rc.getContext(test_ctx_id, new IRunControl.DoneGetContext() {
+ public void doneGetContext(IToken token, Exception error, IRunControl.RunControlContext ctx) {
+ if (error != null) {
+ exit(error);
+ }
+ else if (ctx == null) {
+ exit(new Exception("Invalid test execution context"));
+ }
+ else {
+ test_ctx = ctx;
+ process_id = test_ctx.getProcessID();
+ if (!process_id.equals(test_ctx_id)) {
+ thread_id = test_ctx_id;
+ }
runTest();
}
}
@@ -204,6 +227,9 @@ class TestExpressions implements ITCFTest,
else if (ids == null || ids.length == 0) {
exit(new Exception("Test process has no threads"));
}
+ else if (ids.length != 1) {
+ exit(new Exception("Test process has too many threads"));
+ }
else {
thread_id = ids[0];
runTest();
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
index a3a2e87ec..41217f293 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
@@ -714,7 +714,7 @@ class TestRCBP1 implements ITCFTest,
if (!context_id.equals(mem_ctx.getID())) {
exit(new Exception("Bad memory context data: invalid ID"));
}
- Object pid = context.getProperties().get(IRunControl.PROP_PROCESS_ID);
+ Object pid = context.getProcessID();
if (pid != null && !pid.equals(mem_ctx.getProcessID())) {
exit(new Exception("Bad memory context data: invalid ProcessID"));
}

Back to the top