1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 04:15:35 +02:00

Fix bug 155316.

This commit is contained in:
Ken Ryall 2006-08-26 19:11:29 +00:00
parent 7549d7cec2
commit a2457049ee
2 changed files with 29 additions and 9 deletions

View file

@ -45,4 +45,15 @@ public interface ICDITargetConfiguration2 extends ICDITargetConfiguration {
*/
boolean supportsRuntimeTypeIdentification();
/**
* Returns whether this target supports having address breakpoints
* enabled when a debug session starts.
* If so this means address breaks will not be disabled on startup.
*
* @return whether this target supports having address breakpoints
* enabled when a debug session starts.
* If so this means address breaks will not be disabled on startup.
*/
boolean supportsAddressBreaksOnStartup();
}

View file

@ -43,6 +43,8 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration;
import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration2;
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
@ -850,18 +852,25 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
public void setInitialBreakpoints() {
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
IBreakpoint[] bps = manager.getBreakpoints( CDIDebugModel.getPluginIdentifier() );
for( int i = 0; i < bps.length; i++ ) {
if ( bps[i] instanceof ICBreakpoint && isTargetBreakpoint( (ICBreakpoint)bps[i] ) && !getBreakpointMap().isRegistered( (ICBreakpoint)bps[i] ) ) {
if ( bps[i] instanceof ICAddressBreakpoint ) {
// disable address breakpoints to prevent the debugger to insert them prematurely
try {
bps[i].setEnabled( false );
}
catch( CoreException e ) {
ICDITargetConfiguration config = getDebugTarget().getCDITarget().getConfiguration();
if (!(config instanceof ICDITargetConfiguration2) || !((ICDITargetConfiguration2)config).supportsAddressBreaksOnStartup())
{ // Disable address breaks of the target does not support setting them on startup
for( int i = 0; i < bps.length; i++ ) {
if ( bps[i] instanceof ICBreakpoint && isTargetBreakpoint( (ICBreakpoint)bps[i] ) && !getBreakpointMap().isRegistered( (ICBreakpoint)bps[i] ) ) {
if ( bps[i] instanceof ICAddressBreakpoint ) {
// disable address breakpoints to prevent the debugger to insert them prematurely
try {
bps[i].setEnabled( false );
}
catch( CoreException e ) {
}
}
}
}
}
}
ICBreakpoint[] breakpoints = register( bps );
setBreakpointsOnTarget0( breakpoints );
}