1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Fixed bug 166774. Restart tries to set a breakpoint on main regardless of whether the stop on main checkbox is checked or not.

This commit is contained in:
John Cortell 2006-12-15 18:00:09 +00:00
parent ab07486e81
commit 66948345f0

View file

@ -107,6 +107,7 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IExpressionListener; import org.eclipse.debug.core.IExpressionListener;
import org.eclipse.debug.core.IExpressionManager; import org.eclipse.debug.core.IExpressionManager;
import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchListener; import org.eclipse.debug.core.ILaunchListener;
import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.debug.core.model.IDebugTarget;
@ -899,15 +900,19 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
if ( !canRestart() ) { if ( !canRestart() ) {
return; return;
} }
String mainSymbol = new String( ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT );
try { try {
ILaunchConfiguration launchConfig = getLaunch().getLaunchConfiguration();
if (launchConfig.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false)) {
String mainSymbol = new String( ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT );
mainSymbol = getLaunch().getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT ); mainSymbol = getLaunch().getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT );
ICDILocation location = getCDITarget().createFunctionLocation( "", mainSymbol ); //$NON-NLS-1$
setInternalTemporaryBreakpoint( location );
}
} }
catch( CoreException e ) { catch( CoreException e ) {
requestFailed( e.getMessage(), e ); requestFailed( e.getMessage(), e );
} }
ICDILocation location = getCDITarget().createFunctionLocation( "", mainSymbol ); //$NON-NLS-1$
setInternalTemporaryBreakpoint( location );
final CDebugElementState newState = CDebugElementState.RESTARTING; final CDebugElementState newState = CDebugElementState.RESTARTING;
changeState( newState ); changeState( newState );
try { try {