mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 242105
When non-stop mode is requested by the user, the FinalLaunchSequence now issues: maint set linux-async 1 set breakpoint always-inserted 1 -gdb-set non-stop on Ultimately, with the official GDB release, only the last command should be needed.
This commit is contained in:
parent
15070bcc55
commit
3b749fe80a
2 changed files with 92 additions and 10 deletions
|
@ -53,9 +53,11 @@ 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.MIFileExecAndSymbols;
|
||||||
import org.eclipse.dd.mi.service.command.commands.MIGDBSetArgs;
|
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.MIGDBSetAutoSolib;
|
||||||
|
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.MIGDBSetSolibSearchPath;
|
||||||
import org.eclipse.dd.mi.service.command.commands.MIGDBSetSysroot;
|
import org.eclipse.dd.mi.service.command.commands.MIGDBSetSysroot;
|
||||||
import org.eclipse.dd.mi.service.command.commands.MITargetSelect;
|
import org.eclipse.dd.mi.service.command.commands.MITargetSelect;
|
||||||
|
import org.eclipse.dd.mi.service.command.commands.RawCommand;
|
||||||
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
import org.eclipse.dd.mi.service.command.output.MIInfo;
|
||||||
import org.eclipse.debug.core.DebugPlugin;
|
import org.eclipse.debug.core.DebugPlugin;
|
||||||
import org.eclipse.debug.core.IStatusHandler;
|
import org.eclipse.debug.core.IStatusHandler;
|
||||||
|
@ -68,13 +70,22 @@ public class FinalLaunchSequence extends Sequence {
|
||||||
*/
|
*/
|
||||||
new Step() { @Override
|
new Step() { @Override
|
||||||
public void execute(RequestMonitor requestMonitor) {
|
public void execute(RequestMonitor requestMonitor) {
|
||||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fLaunch.getSession().getId());
|
fTracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fLaunch.getSession().getId());
|
||||||
fCommandControl = tracker.getService(GDBControl.class);
|
requestMonitor.done();
|
||||||
fProcService = tracker.getService(GDBProcesses.class);
|
}
|
||||||
|
@Override
|
||||||
|
public void rollBack(RequestMonitor requestMonitor) {
|
||||||
|
if (fTracker != null) fTracker.dispose();
|
||||||
|
fTracker = null;
|
||||||
|
requestMonitor.done();
|
||||||
|
}},
|
||||||
|
new Step() { @Override
|
||||||
|
public void execute(RequestMonitor requestMonitor) {
|
||||||
|
fCommandControl = fTracker.getService(GDBControl.class);
|
||||||
|
fProcService = fTracker.getService(GDBProcesses.class);
|
||||||
if (fCommandControl == null || fProcService == null) {
|
if (fCommandControl == null || fProcService == null) {
|
||||||
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain service", null)); //$NON-NLS-1$
|
requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot obtain service", null)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
tracker.dispose();
|
|
||||||
|
|
||||||
requestMonitor.done();
|
requestMonitor.done();
|
||||||
}},
|
}},
|
||||||
|
@ -209,6 +220,44 @@ public class FinalLaunchSequence extends Sequence {
|
||||||
requestMonitor.done();
|
requestMonitor.done();
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
/*
|
||||||
|
* Enable non-stop mode if necessary
|
||||||
|
*/
|
||||||
|
new Step() { @Override
|
||||||
|
public void execute(final RequestMonitor requestMonitor) {
|
||||||
|
boolean isNonStop = false;
|
||||||
|
try {
|
||||||
|
isNonStop = fLaunch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
|
||||||
|
IGDBLaunchConfigurationConstants.DEBUGGER_NON_STOP_DEFAULT);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// GDBs that don't support non-stop don't allow you to set it to false.
|
||||||
|
// We really should set it to false when GDB supports it though.
|
||||||
|
// Something to fix later.
|
||||||
|
if (isNonStop) {
|
||||||
|
// The two raw commands should not be necessary in the official GDB release
|
||||||
|
fCommandControl.queueCommand(
|
||||||
|
new RawCommand(fCommandControl.getControlDMContext(), "maint set linux-async 1"), //$NON-NLS-1$
|
||||||
|
new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor) {
|
||||||
|
@Override
|
||||||
|
protected void handleSuccess() {
|
||||||
|
fCommandControl.queueCommand(
|
||||||
|
new RawCommand(fCommandControl.getControlDMContext(), "set breakpoint always-inserted 1"), //$NON-NLS-1$
|
||||||
|
new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor) {
|
||||||
|
@Override
|
||||||
|
protected void handleSuccess() {
|
||||||
|
fCommandControl.queueCommand(
|
||||||
|
new MIGDBSetNonStop(fCommandControl.getControlDMContext(), true),
|
||||||
|
new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
requestMonitor.done();
|
||||||
|
}
|
||||||
|
}},
|
||||||
/*
|
/*
|
||||||
* Tell GDB to automatically load or not the shared library symbols
|
* Tell GDB to automatically load or not the shared library symbols
|
||||||
*/
|
*/
|
||||||
|
@ -263,9 +312,7 @@ public class FinalLaunchSequence extends Sequence {
|
||||||
*/
|
*/
|
||||||
new Step() { @Override
|
new Step() { @Override
|
||||||
public void execute(RequestMonitor requestMonitor) {
|
public void execute(RequestMonitor requestMonitor) {
|
||||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fLaunch.getSession().getId());
|
CSourceLookup sourceLookup = fTracker.getService(CSourceLookup.class);
|
||||||
CSourceLookup sourceLookup = tracker.getService(CSourceLookup.class);
|
|
||||||
tracker.dispose();
|
|
||||||
|
|
||||||
CSourceLookupDirector locator = (CSourceLookupDirector)fLaunch.getSourceLocator();
|
CSourceLookupDirector locator = (CSourceLookupDirector)fLaunch.getSourceLocator();
|
||||||
sourceLookup.setSourceLookupPath(fCommandControl.getGDBDMContext(),
|
sourceLookup.setSourceLookupPath(fCommandControl.getGDBDMContext(),
|
||||||
|
@ -482,9 +529,7 @@ public class FinalLaunchSequence extends Sequence {
|
||||||
*/
|
*/
|
||||||
new Step() { @Override
|
new Step() { @Override
|
||||||
public void execute(final RequestMonitor requestMonitor) {
|
public void execute(final RequestMonitor requestMonitor) {
|
||||||
DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fLaunch.getSession().getId());
|
MIBreakpointsManager bpmService = fTracker.getService(MIBreakpointsManager.class);
|
||||||
MIBreakpointsManager bpmService = tracker.getService(MIBreakpointsManager.class);
|
|
||||||
tracker.dispose();
|
|
||||||
bpmService.startTrackingBreakpoints(fCommandControl.getGDBDMContext(), requestMonitor);
|
bpmService.startTrackingBreakpoints(fCommandControl.getGDBDMContext(), requestMonitor);
|
||||||
}},
|
}},
|
||||||
/*
|
/*
|
||||||
|
@ -496,6 +541,17 @@ public class FinalLaunchSequence extends Sequence {
|
||||||
fCommandControl.start(fLaunch, requestMonitor);
|
fCommandControl.start(fLaunch, requestMonitor);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
|
* Cleanup
|
||||||
|
*/
|
||||||
|
new Step() {
|
||||||
|
@Override
|
||||||
|
public void execute(final RequestMonitor requestMonitor) {
|
||||||
|
fTracker.dispose();
|
||||||
|
fTracker = null;
|
||||||
|
requestMonitor.done();
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
GdbLaunch fLaunch;
|
GdbLaunch fLaunch;
|
||||||
|
@ -504,6 +560,7 @@ public class FinalLaunchSequence extends Sequence {
|
||||||
|
|
||||||
GDBControl fCommandControl;
|
GDBControl fCommandControl;
|
||||||
GDBProcesses fProcService;
|
GDBProcesses fProcService;
|
||||||
|
DsfServicesTracker fTracker;
|
||||||
|
|
||||||
public FinalLaunchSequence(DsfExecutor executor, GdbLaunch launch, SessionType sessionType, boolean attach) {
|
public FinalLaunchSequence(DsfExecutor executor, GdbLaunch launch, SessionType sessionType, boolean attach) {
|
||||||
super(executor);
|
super(executor);
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2008 Ericsson and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Ericsson - Initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.dd.mi.service.command.commands;
|
||||||
|
|
||||||
|
import org.eclipse.dd.mi.service.command.MIControlDMContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* -gdb-set non-stop [on | off]
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class MIGDBSetNonStop extends MIGDBSet
|
||||||
|
{
|
||||||
|
public MIGDBSetNonStop(MIControlDMContext ctx, boolean isSet) {
|
||||||
|
super(ctx, new String[] {"non-stop", isSet ? "on" : "off"});//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue