diff options
author | Simon Marchi | 2015-01-16 15:21:09 +0000 |
---|---|---|
committer | Marc Khouzam | 2015-01-16 19:42:04 +0000 |
commit | ac6e5420d9a0cba37460296d4e63d25ae0bcdc38 (patch) | |
tree | 70e2ebef90533d8182e6ac9f85aeabde058e9210 | |
parent | 568e8a995bd6406ec6879d9ed5727809613370d0 (diff) | |
download | org.eclipse.cdt-ac6e5420d9a0cba37460296d4e63d25ae0bcdc38.tar.gz org.eclipse.cdt-ac6e5420d9a0cba37460296d4e63d25ae0bcdc38.tar.xz org.eclipse.cdt-ac6e5420d9a0cba37460296d4e63d25ae0bcdc38.zip |
debug tests: Remove runToLine
runToLine uses gdb's -exec-until, which has a very strange and
unpredictable behaviour. It is safer to use runToLocation, which uses a
temporary breakpoint + continue.
Change-Id: If7bbbdd12570b50f38eb92f1748d10dff96f1f45
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/39769
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
3 files changed, 4 insertions, 55 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java index 54be9145d37..6704a14a7b9 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/SyncUtil.java @@ -173,54 +173,6 @@ public class SyncUtil { return eventWaitor.waitForEvent(timeout); } - public static MIStoppedEvent runToLine(final IExecutionDMContext dmc, final String fileName, final int lineNo, - final boolean skipBreakpoints) throws Throwable { - return runToLine(dmc, fileName, lineNo, skipBreakpoints, DefaultTimeouts.get(ETimeout.runToLine)); - } - - public static MIStoppedEvent runToLine(final IExecutionDMContext dmc, final String fileName, final int lineNo, - final boolean skipBreakpoints, final int timeout) throws Throwable { - - final ServiceEventWaitor<MIStoppedEvent> eventWaitor = - new ServiceEventWaitor<MIStoppedEvent>( - fSession, - MIStoppedEvent.class); - - fRunControl.getExecutor().submit(new Runnable() { - @Override - public void run() { - // No need for a RequestMonitor since we will wait for the - // ServiceEvent telling us the program has been suspended again - - fGdbControl.queueCommand( - fCommandFactory.createMIExecUntil(dmc, fileName + ":" + lineNo), //$NON-NLS-1$ - null); - } - }); - - // Wait for the execution to suspend after the step - return eventWaitor.waitForEvent(timeout); - } - - public static MIStoppedEvent runToLine(String fileName, int lineNo, - boolean skipBreakpoints) throws Throwable { - return runToLine(fileName, lineNo, skipBreakpoints, DefaultTimeouts.get(ETimeout.runToLine)); - } - - public static MIStoppedEvent runToLine(String fileName, int lineNo, - boolean skipBreakpoints, int timeout) throws Throwable { - IContainerDMContext containerDmc = SyncUtil.getContainerContext(); - return runToLine(containerDmc, fileName, lineNo, skipBreakpoints, timeout); - } - - public static MIStoppedEvent runToLine(String fileName, int lineNo) throws Throwable { - return runToLine(fileName, lineNo, DefaultTimeouts.get(ETimeout.runToLine)); - } - - public static MIStoppedEvent runToLine(String fileName, int lineNo, int timeout) throws Throwable { - return runToLine(fileName, lineNo, false, timeout); - } - public static int addBreakpoint(String location) throws Throwable { return addBreakpoint(location, DefaultTimeouts.get(ETimeout.addBreakpoint)); } diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRegistersTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRegistersTest.java index 533ea0328e2..5d7010072a7 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRegistersTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRegistersTest.java @@ -364,8 +364,8 @@ public class MIRegistersTest extends BaseTestCase { @Test public void compareRegisterForMultipleExecutionContexts() throws Throwable { - MIStoppedEvent stoppedEvent = SyncUtil.runToLine(SOURCE_NAME, - getLineForTag("LINE_MAIN_ALL_THREADS_STARTED")); + MIStoppedEvent stoppedEvent = SyncUtil.runToLocation(SOURCE_NAME + ':' + + getLineForTag("LINE_MAIN_ALL_THREADS_STARTED")); // Get the thread IDs final IContainerDMContext containerDmc = DMContexts.getAncestorOfType(stoppedEvent.getDMContext(), IContainerDMContext.class); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java index 2a1f439915b..836121bad39 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java @@ -274,11 +274,8 @@ public class MIRunControlTest extends BaseTestCase { getGDBLaunch().getSession(), IStartedDMEvent.class); - SyncUtil.runToLine( - fContainerDmc, - SOURCE_NAME, - getLineForTag("LINE_MAIN_AFTER_THREAD_START"), - true); + SyncUtil.runToLocation(SOURCE_NAME + ':' + + getLineForTag("LINE_MAIN_AFTER_THREAD_START")); final IContainerDMContext containerDmc = SyncUtil.getContainerContext(); |