Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorJohn Cortell2007-02-07 18:07:34 +0000
committerJohn Cortell2007-02-07 18:07:34 +0000
commite1ca2d84efc13e05b1317193ea93d25bc0828cdd (patch)
tree021885867886dbf31a4f5dfc55bd858a63fbaf20 /debug
parent09a6509ebff2a41d7a936f38158635b6c506feb0 (diff)
downloadorg.eclipse.cdt-e1ca2d84efc13e05b1317193ea93d25bc0828cdd.tar.gz
org.eclipse.cdt-e1ca2d84efc13e05b1317193ea93d25bc0828cdd.tar.xz
org.eclipse.cdt-e1ca2d84efc13e05b1317193ea93d25bc0828cdd.zip
User can now specify a memory address for the stop on start point (173201)
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java32
1 files changed, 27 insertions, 5 deletions
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 51c40e0da71..5c0cf3dc617 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
@@ -282,8 +282,16 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
ICDITargetConfiguration config = getConfiguration();
if ( config.supportsBreakpoints() ) {
getBreakpointManager().setInitialBreakpoints();
+
if ( stopSymbol != null && stopSymbol.length() != 0 ) {
- stopAtSymbol( stopSymbol );
+ // See if the expression is a numeric address
+ try {
+ IAddress address = getAddressFactory().createAddress(stopSymbol);
+ stopAtAddress(address);
+ } catch (NumberFormatException nfexc) {
+ // OK, expression is not a simple, absolute numeric value; keep trucking and try to resolve as expression
+ stopAtSymbol( stopSymbol );
+ }
}
}
if ( config.supportsResume() && resume ) {
@@ -1733,27 +1741,41 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
getBreakpointManager().skipBreakpoints( enabled );
}
- protected void stopAtSymbol( String stopSymbol ) throws DebugException {
+ /**
+ * 'stopExpression' is used solely for the error message if the request
+ * fails. Where to stop is dictated entirely by 'location'
+ * @param symbol
+ */
+ private void stopAtLocation(ICDILocation location, String stopExpression ) throws DebugException {
try {
- ICDILocation location = getCDITarget().createFunctionLocation( "", stopSymbol ); //$NON-NLS-1$
setInternalTemporaryBreakpoint( location );
}
catch( CoreException e ) {
boolean isTerminated = getCDITarget().isTerminated();
if ( isTerminated ) {
- String message = MessageFormat.format( CoreModelMessages.getString( "CDebugTarget.0" ), new String[]{ stopSymbol } ); //$NON-NLS-1$
+ String message = MessageFormat.format( CoreModelMessages.getString( "CDebugTarget.0" ), new String[]{ stopExpression } ); //$NON-NLS-1$
MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(), IStatus.OK, message, null );
status.add( e.getStatus() );
throw new DebugException( status );
}
- String message = MessageFormat.format( CoreModelMessages.getString( "CDebugTarget.2" ), new String[]{ stopSymbol, e.getStatus().getMessage() } ); //$NON-NLS-1$
+ String message = MessageFormat.format( CoreModelMessages.getString( "CDebugTarget.2" ), new String[]{ stopExpression, e.getStatus().getMessage() } ); //$NON-NLS-1$
IStatus newStatus = new Status( IStatus.WARNING, e.getStatus().getPlugin(), ICDebugInternalConstants.STATUS_CODE_QUESTION, message, null );
if ( !CDebugUtils.question( newStatus, this ) ) {
throw new DebugException( new Status( IStatus.OK, e.getStatus().getPlugin(), e.getStatus().getCode(), e.getStatus().getMessage(), null ) );
}
}
}
+
+ protected void stopAtSymbol( String stopSymbol ) throws DebugException {
+ ICDILocation location = getCDITarget().createFunctionLocation( "", stopSymbol ); //$NON-NLS-1$
+ stopAtLocation(location, stopSymbol);
+ }
+ protected void stopAtAddress( IAddress address ) throws DebugException {
+ ICDIAddressLocation location = getCDITarget().createAddressLocation(address.getValue());
+ stopAtLocation(location, address.toHexAddressString());
+ }
+
protected void stopInMain() throws DebugException {
String mainSymbol = new String( ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT );
try {

Back to the top