1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Bug 176081 - In multi-process debug, breakpoint is mistakenly uninstalled on process termination. Patch from Ling Wang.

This commit is contained in:
Ken Ryall 2007-05-04 22:24:46 +00:00
parent eb9921b9e1
commit 87b26cc99e

View file

@ -9,6 +9,7 @@
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
* Matthias Spycher (matthias@coware.com) - patch for bug #112008 * Matthias Spycher (matthias@coware.com) - patch for bug #112008
* Ken Ryall (Nokia) - bugs 170027, 105196 * Ken Ryall (Nokia) - bugs 170027, 105196
* Ling Wang (Nokia) - bug 176081
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.debug.internal.core; package org.eclipse.cdt.debug.internal.core;
@ -619,19 +620,26 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
marker.delete(); marker.delete();
} catch (CoreException e) {} } catch (CoreException e) {}
} }
ArrayList list = new ArrayList();
ArrayList installedCDIBplist = new ArrayList();
ArrayList installedCBplist = new ArrayList();
ICBreakpoint[] breakpoints = new ICBreakpoint[0]; ICBreakpoint[] breakpoints = new ICBreakpoint[0];
synchronized( getBreakpointMap() ) { synchronized( getBreakpointMap() ) {
breakpoints = getBreakpointMap().getAllCBreakpoints(); breakpoints = getBreakpointMap().getAllCBreakpoints();
for ( int i = 0; i < breakpoints.length; ++i ) { for ( int i = 0; i < breakpoints.length; ++i ) {
if ( !getBreakpointMap().isInProgress( breakpoints[i] ) ) if ( !getBreakpointMap().isInProgress( breakpoints[i] ) ) {
list.add( getBreakpointMap().getCDIBreakpoint( breakpoints[i] ) ); installedCDIBplist.add( getBreakpointMap().getCDIBreakpoint( breakpoints[i] ) );
installedCBplist.add(breakpoints[i]);
}
} }
} }
if ( list.isEmpty() ) if ( installedCDIBplist.isEmpty() )
return; return;
final ICDIBreakpoint[] cdiBreakpoints = (ICDIBreakpoint[])list.toArray( new ICDIBreakpoint[list.size()] );
final ICDIBreakpoint[] cdiBreakpoints = (ICDIBreakpoint[])installedCDIBplist.toArray( new ICDIBreakpoint[installedCDIBplist.size()] );
final ICDITarget cdiTarget = getCDITarget(); final ICDITarget cdiTarget = getCDITarget();
DebugPlugin.getDefault().asyncExec( new Runnable() { DebugPlugin.getDefault().asyncExec( new Runnable() {
public void run() { public void run() {
try { try {
@ -640,8 +648,9 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
catch( CDIException e ) { catch( CDIException e ) {
} }
} }
} ); } );
getBreakpointNotifier().breakpointsRemoved( getDebugTarget(), breakpoints );
getBreakpointNotifier().breakpointsRemoved( getDebugTarget(), (ICBreakpoint[])installedCBplist.toArray( new ICBreakpoint[installedCBplist.size()] ) );
} }
private ICBreakpoint[] register( IBreakpoint[] breakpoints ) { private ICBreakpoint[] register( IBreakpoint[] breakpoints ) {