Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2004-05-28 17:27:58 -0400
committerMikhail Khodjaiants2004-05-28 17:27:58 -0400
commite37b85c532f7e94988c39c4ef8277b5f878f9dad (patch)
treec3a238d41020001cb22345b08db1fb019af636c5
parentc839041374bf89f46fb5e19114a9a66ca27bb845 (diff)
downloadorg.eclipse.cdt-e37b85c532f7e94988c39c4ef8277b5f878f9dad.tar.gz
org.eclipse.cdt-e37b85c532f7e94988c39c4ef8277b5f878f9dad.tar.xz
org.eclipse.cdt-e37b85c532f7e94988c39c4ef8277b5f878f9dad.zip
Support for the "Skip All Breakpoints" action.
-rw-r--r--debug/org.eclipse.cdt.debug.core/ChangeLog4
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java36
2 files changed, 38 insertions, 2 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog
index 7873bc3412..0dfd608af9 100644
--- a/debug/org.eclipse.cdt.debug.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.core/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-28 Mikhail Khodjaiants
+ Support for the "Skip All Breakpoints" action.
+ * CBreakpointManager.java
+
2004-05-27 Mikhail Khodjaiants
Display global variables in the Variables view.
* CDIDebugModel.java
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
index f5f9c5a9aa..e33316d434 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
@@ -48,6 +48,8 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.IBreakpointManagerListener;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.ISourceLocator;
@@ -56,7 +58,7 @@ import org.eclipse.debug.core.model.ISourceLocator;
* The breakpoint manager manages all breakpoints set to the associated
* debug target.
*/
-public class CBreakpointManager implements ICDIEventListener, IAdaptable {
+public class CBreakpointManager implements IBreakpointManagerListener, ICDIEventListener, IAdaptable {
private class BreakpointMap {
@@ -128,6 +130,7 @@ public class CBreakpointManager implements ICDIEventListener, IAdaptable {
super();
setDebugTarget( target );
fMap = new BreakpointMap();
+ DebugPlugin.getDefault().getBreakpointManager().addBreakpointManagerListener( this );
getDebugTarget().getCDISession().getEventManager().addEventListener( this );
}
@@ -167,6 +170,7 @@ public class CBreakpointManager implements ICDIEventListener, IAdaptable {
public void dispose() {
getDebugTarget().getCDISession().getEventManager().removeEventListener( this );
+ DebugPlugin.getDefault().getBreakpointManager().removeBreakpointManagerListener( this );
removeAllBreakpoints();
getBreakpointMap().dispose();
}
@@ -392,10 +396,17 @@ public class CBreakpointManager implements ICDIEventListener, IAdaptable {
if ( breakpoint != null ) {
Map map = new HashMap( 3 );
try {
- map.put( IBreakpoint.ENABLED, new Boolean( cdiBreakpoint.isEnabled() ) );
+ if ( DebugPlugin.getDefault().getBreakpointManager().isEnabled() ) {
+ map.put( IBreakpoint.ENABLED, new Boolean( cdiBreakpoint.isEnabled() ) );
+ }
+ else {
+ map.put( IBreakpoint.ENABLED, new Boolean( breakpoint.isEnabled() ) );
+ }
}
catch( CDIException e ) {
}
+ catch( CoreException e ) {
+ }
try {
map.put( ICBreakpoint.IGNORE_COUNT, new Integer( cdiBreakpoint.getCondition().getIgnoreCount() ) );
}
@@ -615,4 +626,25 @@ public class CBreakpointManager implements ICDIEventListener, IAdaptable {
private boolean isEmpty( String str ) {
return !( str != null && str.trim().length() > 0 );
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
+ */
+ public void breakpointManagerEnablementChanged( boolean enabled ) {
+ ICBreakpoint[] cBreakpoints = getBreakpointMap().getAllCBreakpoints();
+ for ( int i = 0; i < cBreakpoints.length; ++i ) {
+ try {
+ if ( cBreakpoints[i].isEnabled() ) {
+ ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( cBreakpoints[i] );
+ if ( cdiBreakpoint != null ) {
+ cdiBreakpoint.setEnabled( enabled );
+ }
+ }
+ }
+ catch( CoreException e ) {
+ }
+ catch( CDIException e ) {
+ }
+ }
+ }
} \ No newline at end of file

Back to the top