From 02e236eed653572c6330d62ced24239676298420 Mon Sep 17 00:00:00 2001 From: John Cortell Date: Thu, 22 Mar 2007 20:44:15 +0000 Subject: [PATCH] Support for a numeric address value being the stop on start expression was added last month, but the restart() case was not covered. This adds the missing support --- .../cdt/debug/internal/core/model/CDebugTarget.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index 21870fd443a..17c85b9825b 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -906,7 +906,16 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv ILaunchConfiguration launchConfig = getLaunch().getLaunchConfiguration(); if ( launchConfig.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_DEFAULT ) ) { String mainSymbol = launchConfig.getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT ); - ICDILocation location = getCDITarget().createFunctionLocation( "", mainSymbol ); //$NON-NLS-1$ + ICDILocation location = null; + // See if the expression is a numeric address + try { + IAddress address = getAddressFactory().createAddress(mainSymbol); + location = getCDITarget().createAddressLocation( address.getValue() ); + } catch (NumberFormatException nfexc) { + // OK, expression is not a simple, absolute numeric value; keep trucking and try to resolve as expression + location = getCDITarget().createFunctionLocation( "", mainSymbol ); //$NON-NLS-1$ + } + setInternalTemporaryBreakpoint( location ); } }