From dfe9381a72d8b85b6b5352bc803b9f4d3d5acff6 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 26 Nov 2008 15:50:24 +0000 Subject: [PATCH] [252782] Adapt the launch sequence to the latest non-stop syntax. "set breakpoint apply global" does not exist anymore. "set breakpoint always-inserted" is no longer needed because GDB does it automatically for non-stop. "maint set remote-async 1" and "maint set linux-async 1" are replaced by a simpler "set target-async on" Also, I changed the version of the GDB that supports multi-process. This GDB is not actually available publicly yet, but it works for the preliminary release I have. Once GDB 7 is out, we will change the version again. --- .../launching/FinalLaunchSequence.java | 63 +++++-------------- .../service/GdbDebugServicesFactory.java | 2 +- 2 files changed, 17 insertions(+), 48 deletions(-) diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java index 28460a53414..da406c0bed7 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/launching/FinalLaunchSequence.java @@ -42,7 +42,6 @@ import org.eclipse.dd.mi.service.command.commands.MIEnvironmentCD; import org.eclipse.dd.mi.service.command.commands.MIFileExecAndSymbols; import org.eclipse.dd.mi.service.command.commands.MIGDBSetArgs; import org.eclipse.dd.mi.service.command.commands.MIGDBSetAutoSolib; -import org.eclipse.dd.mi.service.command.commands.MIGDBSetBreakpointApply; import org.eclipse.dd.mi.service.command.commands.MIGDBSetNonStop; import org.eclipse.dd.mi.service.command.commands.MIGDBSetSolibSearchPath; import org.eclipse.dd.mi.service.command.commands.MITargetSelect; @@ -199,22 +198,6 @@ public class FinalLaunchSequence extends Sequence { requestMonitor.done(); } }}, - /* - * Tell GDB to have breakpoint affect all processes being debugged. - * The user should actually make this decision. See bug 244053 - */ - new Step() { @Override - public void execute(final RequestMonitor requestMonitor) { - fCommandControl.queueCommand( - // This command will fail for GDBs without multi-process support, and that is ok - new MIGDBSetBreakpointApply(fCommandControl.getContext(), true), - new DataRequestMonitor(getExecutor(), requestMonitor) { - @Override - protected void handleCompleted() { - requestMonitor.done(); - } - }); - }}, /* * Enable non-stop mode if necessary */ @@ -233,36 +216,22 @@ public class FinalLaunchSequence extends Sequence { if (isNonStop) { // The raw commands should not be necessary in the official GDB release fCommandControl.queueCommand( - new RawCommand(fCommandControl.getContext(), "set breakpoint always-inserted"), //$NON-NLS-1$ - new DataRequestMonitor(getExecutor(), requestMonitor) { - @Override - protected void handleSuccess() { - String asyncCommandStr; - if (fSessionType == SessionType.REMOTE) { - asyncCommandStr = "maint set remote-async 1"; //$NON-NLS-1$ - } else { - asyncCommandStr = "maint set linux-async 1"; //$NON-NLS-1$ - } - - fCommandControl.queueCommand( - new RawCommand(fCommandControl.getContext(), asyncCommandStr), - new DataRequestMonitor(getExecutor(), requestMonitor) { - @Override - protected void handleSuccess() { - fCommandControl.queueCommand( - new RawCommand(fCommandControl.getContext(), "set pagination off"), //$NON-NLS-1$ - new DataRequestMonitor(getExecutor(), requestMonitor) { - @Override - protected void handleSuccess() { - fCommandControl.queueCommand( - new MIGDBSetNonStop(fCommandControl.getContext(), true), - new DataRequestMonitor(getExecutor(), requestMonitor)); - } - }); - } - }); - } - }); + new RawCommand(fCommandControl.getContext(), "set target-async on"), //$NON-NLS-1$ + new DataRequestMonitor(getExecutor(), requestMonitor) { + @Override + protected void handleSuccess() { + fCommandControl.queueCommand( + new RawCommand(fCommandControl.getContext(), "set pagination off"), //$NON-NLS-1$ + new DataRequestMonitor(getExecutor(), requestMonitor) { + @Override + protected void handleSuccess() { + fCommandControl.queueCommand( + new MIGDBSetNonStop(fCommandControl.getContext(), true), + new DataRequestMonitor(getExecutor(), requestMonitor)); + } + }); + } + }); } else { requestMonitor.done(); } diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactory.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactory.java index 00c45919f22..5c576919967 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactory.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/provisional/service/GdbDebugServicesFactory.java @@ -120,7 +120,7 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory { @Override protected IProcesses createProcessesService(DsfSession session) { - if (fVersion.startsWith("6.8.50.20080730")) { //$NON-NLS-1$ + if (fVersion.startsWith("6.8.50.20081118")) { //$NON-NLS-1$ return new GDBProcesses_7_0(session); } return new GDBProcesses(session);