mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-30 21:55:31 +02:00
Bug 347245: Add configurable defaults for Stop in main and for Non-stop mode
This commit is contained in:
parent
56b100f37c
commit
6c08d0dc7d
4 changed files with 11 additions and 12 deletions
|
@ -457,22 +457,22 @@ public class LaunchUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns workspace-level default for the Stop in main option.
|
||||
* Returns workspace-level default for the stop at main option.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public static boolean getStopInMainDefault() {
|
||||
public static boolean getStopAtMainDefault() {
|
||||
return Platform.getPreferencesService().getBoolean(GDB_UI_PLUGIN_ID,
|
||||
IGdbDebugPreferenceConstants.PREF_DEFAULT_STOP_AT_MAIN,
|
||||
ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_DEFAULT, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns workspace-level default for the Stop in main symbol.
|
||||
* Returns workspace-level default for the stop at main symbol.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public static String getStopInMainSymbolDefault() {
|
||||
public static String getStopAtMainSymbolDefault() {
|
||||
return Platform.getPreferencesService().getString(GDB_UI_PLUGIN_ID,
|
||||
IGdbDebugPreferenceConstants.PREF_DEFAULT_STOP_AT_MAIN_SYMBOL,
|
||||
ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT, null);
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.cdt.dsf.gdb.IGdbDebugConstants;
|
|||
import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
|
||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||
import org.eclipse.cdt.dsf.gdb.launching.InferiorRuntimeProcess;
|
||||
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
|
||||
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMICommandControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
||||
|
@ -581,7 +582,7 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
|
|||
|
||||
boolean stopInMain = CDebugUtils.getAttribute(attributes,
|
||||
ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN,
|
||||
false);
|
||||
LaunchUtils.getStopAtMainDefault());
|
||||
|
||||
if (!stopInMain) {
|
||||
// Just start the program.
|
||||
|
@ -589,7 +590,7 @@ public class GDBProcesses extends MIProcesses implements IGDBProcesses {
|
|||
} else {
|
||||
String stopSymbol = CDebugUtils.getAttribute(attributes,
|
||||
ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL,
|
||||
ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT);
|
||||
LaunchUtils.getStopAtMainSymbolDefault());
|
||||
|
||||
// Insert a breakpoint at the requested stop symbol.
|
||||
IBreakpointsTargetDMContext bpTarget = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class);
|
||||
|
|
|
@ -191,12 +191,12 @@ public class StartOrRestartProcessSequence_7_0 extends ReflectionSequence {
|
|||
public void stepInsertStopOnMainBreakpoint(final RequestMonitor rm) {
|
||||
boolean userRequestedStop = CDebugUtils.getAttribute(fAttributes,
|
||||
ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN,
|
||||
LaunchUtils.getStopInMainDefault());
|
||||
LaunchUtils.getStopAtMainDefault());
|
||||
|
||||
if (userRequestedStop) {
|
||||
String userStopSymbol = CDebugUtils.getAttribute(fAttributes,
|
||||
ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL,
|
||||
LaunchUtils.getStopInMainSymbolDefault());
|
||||
LaunchUtils.getStopAtMainSymbolDefault());
|
||||
|
||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(getContainerContext(),
|
||||
IBreakpointsTargetDMContext.class);
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.eclipse.cdt.debug.core.CDebugUtils;
|
|||
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContribution;
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.GDBJtagDeviceContributionFactory;
|
||||
import org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice;
|
||||
import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector;
|
||||
import org.eclipse.cdt.dsf.concurrent.CountingRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
|
||||
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
|
||||
|
@ -41,14 +40,13 @@ import org.eclipse.cdt.dsf.concurrent.Sequence;
|
|||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||
import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent;
|
||||
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext;
|
||||
import org.eclipse.cdt.dsf.debug.service.ISourceLookup.ISourceLookupDMContext;
|
||||
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
|
||||
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
|
||||
import org.eclipse.cdt.dsf.gdb.launching.LaunchMessages;
|
||||
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
|
||||
import org.eclipse.cdt.dsf.gdb.service.IGDBBackend;
|
||||
import org.eclipse.cdt.dsf.gdb.service.SessionType;
|
||||
import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl;
|
||||
import org.eclipse.cdt.dsf.mi.service.CSourceLookup;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext;
|
||||
import org.eclipse.cdt.dsf.mi.service.IMIProcesses;
|
||||
import org.eclipse.cdt.dsf.mi.service.MIBreakpointsManager;
|
||||
|
@ -259,7 +257,7 @@ public class GDBJtagDSFFinalLaunchSequence extends Sequence {
|
|||
boolean isNonStop = false;
|
||||
try {
|
||||
isNonStop = fLaunch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
|
||||
IGDBLaunchConfigurationConstants.DEBUGGER_NON_STOP_DEFAULT);
|
||||
LaunchUtils.getIsNonStopModeDefault());
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue