aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2018-08-22 12:31:49 -0400
committerEugene Tarassov2018-08-22 12:31:49 -0400
commit618694e83ee107c878b5a244b2c6225dcf563860 (patch)
treebfdb88e84447ccb33f5c6e297e6c75d158e2c6fb
parent4a5bebc84c19b2e423634847983e27a8f1211503 (diff)
downloadorg.eclipse.tcf-618694e83ee107c878b5a244b2c6225dcf563860.tar.gz
org.eclipse.tcf-618694e83ee107c878b5a244b2c6225dcf563860.tar.xz
org.eclipse.tcf-618694e83ee107c878b5a244b2c6225dcf563860.zip
TCF Tests: better error reports
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestPathMap.java15
-rw-r--r--plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestRCBP1.java19
2 files changed, 23 insertions, 11 deletions
diff --git a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestPathMap.java b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestPathMap.java
index 1a83fd1c0..e28605400 100644
--- a/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestPathMap.java
+++ b/plugins/org.eclipse.tcf.debug/src/org/eclipse/tcf/internal/debug/tests/TestPathMap.java
@@ -146,7 +146,20 @@ class TestPathMap implements ITCFTest {
private boolean obj_equ(String nm, Object x, Object y) {
if (x == y) return true;
if (x != null && x.equals(y)) return true;
- exit(new Exception("PathMap.get: wrong map data, " + nm + ": " + x + " != " + y));
+ if (x instanceof String && y instanceof String) {
+ int i = 0;
+ String sx = (String)x;
+ String sy = (String)y;
+ while (i < sx.length() && i < sy.length() && sx.charAt(i) == sy.charAt(i)) i++;
+ int cx = i < sx.length() ? sx.charAt(i) : '\0';
+ int cy = i < sy.length() ? sy.charAt(i) : '\0';
+ exit(new Exception("PathMap.get: wrong map data, " + nm + ", offset " + i +
+ ", 0x" + Integer.toHexString(cx) + " != 0x" + Integer.toHexString(cy) +
+ ":\n" + x + "\n" + y));
+ }
+ else {
+ exit(new Exception("PathMap.get: wrong map data, " + nm + ": " + x + " != " + y));
+ }
return false;
}
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 9cedba5ac..4f109d47d 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
@@ -96,9 +96,9 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl.
private boolean done_disassembly;
private int resume_cnt = 0;
private IToken cancel_test_cmd;
- private boolean bp_reset_done;
private boolean bp_set_done;
private boolean bp_change_done;
+ private boolean bp_reset_done;
private boolean bp_sync_done;
private boolean data_bp_area_done;
private ILineNumbers.CodeArea data_bp_area;
@@ -283,10 +283,6 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl.
getTestList();
return;
}
- if (!bp_reset_done) {
- resetBreakpoints();
- return;
- }
if (test_id != null) {
if (test_ctx_id == null) {
startTestContext();
@@ -340,8 +336,9 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl.
assert !all_setup_done;
all_setup_done = true;
for (SuspendedContext s : suspended.values()) resume(s.id);
+ return;
}
- else if (suspended.size() > 0) {
+ if (suspended.size() > 0) {
final int test_cnt = suspended.size();
Runnable done = new Runnable() {
int done_cnt;
@@ -353,10 +350,13 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl.
}
};
for (SuspendedContext sc : suspended.values()) runRegistersTest(sc, done);
+ return;
}
- else {
- exit(null);
+ if (!bp_reset_done) {
+ resetBreakpoints();
+ return;
}
+ exit(null);
}
private void getTestList() {
@@ -434,7 +434,6 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl.
runTest();
return;
}
- // Reset breakpoint list (previous tests might left breakpoints)
srv_breakpoints.set(null, new IBreakpoints.DoneCommand() {
public void doneCommand(IToken token, Exception error) {
if (error != null) {
@@ -1170,7 +1169,7 @@ class TestRCBP1 implements ITCFTest, RunControl.DiagnosticTestDone, IRunControl.
}
}
if (bp_id == null) {
- exit(new Exception("Invalid value of 'BPs' attribute in a context state"));
+ exit(new Exception("Invalid value of 'BPs' attribute in a context state: " + ids));
}
}
}