diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java index 0481aa4c9d3..3f0fb6a19c1 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/command/GDBControl.java @@ -337,9 +337,17 @@ public class GDBControl extends AbstractMIControl { return; } + final DataRequestMonitor execMonitor = new DataRequestMonitor(getExecutor(), requestMonitor) { + @Override + protected void handleSuccess() { + getSession().dispatchEvent(new InferiorStartedDMEvent(getGDBDMContext()), getProperties()); + super.handleSuccess(); + } + }; + if (!stopInMain) { // Just start the program. - queueCommand(execCommand, new DataRequestMonitor(getExecutor(), requestMonitor)); + queueCommand(execCommand, execMonitor); } else { String stopSymbol = null; try { @@ -357,16 +365,7 @@ public class GDBControl extends AbstractMIControl { @Override protected void handleSuccess() { // After the break-insert is done, execute the -exec-run or -exec-continue command. - queueCommand( - execCommand, - new DataRequestMonitor(getExecutor(), requestMonitor) { - @Override - protected void handleSuccess() { - getSession().dispatchEvent( - new InferiorStartedDMEvent(getGDBDMContext()), getProperties()); - super.handleSuccess(); - } - }); + queueCommand(execCommand, execMonitor); } }); }