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

Added an ExecutableReloadedEvent so if the debugger backend detects that code has moved then CBreakpointManager can reinstall the breakpoints.

This commit is contained in:
Ken Ryall 2007-03-29 19:05:20 +00:00
parent 100e69cd8b
commit da5c3c790e
2 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,20 @@
/*******************************************************************************
* Copyright (c) 2007 Nokia and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Nokia - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.core.cdi.event;
/**
*
* Notifies that an executable had been reloaded, perhaps after being rebuilt.
*/
public interface ICDIExecutableReloadedEvent extends ICDIEvent {
}

View file

@ -39,6 +39,7 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDICreatedEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
import org.eclipse.cdt.debug.core.cdi.event.ICDIExecutableReloadedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement2;
@ -362,6 +363,10 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
if ( source instanceof ICDIBreakpoint )
handleBreakpointMovedEvent( (ICDIBreakpointMovedEvent) event );
}
else if ( event instanceof ICDIExecutableReloadedEvent ) {
if ( source instanceof ICDITarget )
handleExecutableReloadedEvent( (ICDIExecutableReloadedEvent) event );
}
else if ( event instanceof ICDIBreakpointProblemEvent ) {
if ( source instanceof ICDIBreakpoint )
handleBreakpointProblemEvent( (ICDIBreakpointProblemEvent) event );
@ -517,6 +522,23 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
}
private void handleExecutableReloadedEvent( ICDIExecutableReloadedEvent reloadedEvent )
{
ArrayList uninstalledCBplist = new ArrayList();
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
IBreakpoint[] breakpoints = manager.getBreakpoints( CDIDebugModel.getPluginIdentifier() );
for (int i = 0; i < breakpoints.length; i++) {
if (breakpoints[i] instanceof ICBreakpoint && (getBreakpointMap().getCDIBreakpoint((ICBreakpoint) breakpoints[i]) == null))
{
uninstalledCBplist.add(breakpoints[i]);
}
}
setBreakpointsOnTarget((IBreakpoint[]) uninstalledCBplist.toArray(new IBreakpoint[uninstalledCBplist.size()]));
}
private void handleBreakpointProblemEvent( ICDIBreakpointProblemEvent problemEvent )
{
ICBreakpoint breakpoint = getBreakpointMap().getCBreakpoint( problemEvent.getBreakpoint() );