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 64bbbfc82b3..d155ab8f6e2 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 @@ -285,6 +285,8 @@ public class SyncUtil { * * @param dmc * @param stepType + * @param reverse + * @param massagedTimeout * @return * @throws Throwable */ @@ -368,7 +370,7 @@ public class SyncUtil { * locations see {@link SyncUtil#addBreakpoint(String) addBreakpoint(String)} * * @param location - * @param massagedTimeout + * @param temporary * @return * @throws Throwable */ @@ -386,7 +388,22 @@ public class SyncUtil { * @return * @throws Throwable */ - private static String addBreakpoint(final String location, final boolean temporary, int massagedTimeout) + public static String addBreakpoint(final String location, boolean temporary, int massagedTimeout) throws Throwable { + return addBreakpoint(location, temporary, false, massagedTimeout); + } + + /** + * Adds a (possible temporary/hardware) breakpoint at {@code location}. For possible + * locations see {@link SyncUtil#addBreakpoint(String) addBreakpoint(String)} + * + * @param location + * @param temporary + * @param hardware + * @param massagedTimeout + * @return + * @throws Throwable + */ + public static String addBreakpoint(final String location, boolean temporary, boolean hardware, int massagedTimeout) throws Throwable { IContainerDMContext containerDmc = SyncUtil.getContainerContext(); @@ -397,7 +414,8 @@ public class SyncUtil { @Override protected void execute(DataRequestMonitor rm) { fGdbControl.queueCommand( - fCommandFactory.createMIBreakInsert(bpTargetDmc, temporary, false, null, 0, location, "0"), rm); + fCommandFactory.createMIBreakInsert(bpTargetDmc, temporary, hardware, null, 0, location, "0"), + rm); } }; @@ -616,7 +634,7 @@ public class SyncUtil { * @throws Throwable */ public static MIStoppedEvent runToLocation(String location) throws Throwable { - return runToLocation(location, DefaultTimeouts.get(ETimeout.runToLocation)); + return runToLocation(location, false, DefaultTimeouts.get(ETimeout.runToLocation)); } /** @@ -629,10 +647,39 @@ public class SyncUtil { * @throws Throwable */ public static MIStoppedEvent runToLocation(String location, int timeout) throws Throwable { + return runToLocation(location, false, DefaultTimeouts.get(ETimeout.runToLocation)); + } + + /** + * Runs the process' execution to {@code location} using a {@code hardware} + * breakpoint. For an example of possible locations see + * {@link SyncUtil#addBreakpoint(String) addBreakpoint(String)} + * + * @param location + * @param timeout + * @return + * + * @throws Throwable + */ + public static MIStoppedEvent runToLocation(String location, boolean hardware) throws Throwable { + return runToLocation(location, hardware, DefaultTimeouts.get(ETimeout.runToLocation)); + } + + /** + * Runs the process' execution to {@code location} using a {@code hardware} + * breakpoint. For an example of possible locations see + * {@link SyncUtil#addBreakpoint(String) addBreakpoint(String)} + * + * @param location + * @param timeout + * @return + * @throws Throwable + */ + public static MIStoppedEvent runToLocation(String location, boolean hardware, int timeout) throws Throwable { // Set a temporary breakpoint and run to it. // Note that if there were other breakpoints set ahead of this one, // they will stop execution earlier than planned - addBreakpoint(location, true, timeout); + addBreakpoint(location, true, hardware, timeout); // Don't provide a timeout so we use the resume default timeout for this step // if a timeout value is provided via DefaultTimeouts the value will be massaged twice return resumeUntilStopped(); @@ -800,7 +847,7 @@ public class SyncUtil { * given process, thread or, frame ({@code parentCtx}). For example, given 2 * thread, thread1 and thread2, an expression may not be valid in the context of * thread1 but it may be valid in the context of thread2. Therefore, while - * creating expression its important that the correct context is passed + * creating expression it's important that the correct context is passed * * @param parentCtx * @param expression @@ -942,14 +989,14 @@ public class SyncUtil { *
  • Massage timeouts i.e. a common multiplier for all timeouts *