From c4ec584fc45578231a4bae3bc19936d529503f00 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Fri, 6 Sep 2002 21:13:24 +0000 Subject: [PATCH] Implementation of the handler of 'WatchpointScope' event. --- .../internal/core/model/CDebugTarget.java | 23 +++++++++++++++++++ .../ui/CDTDebugModelPresentation.java | 5 ++++ 2 files changed, 28 insertions(+) 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 926cbf3614d..d872e96f3bc 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 @@ -1222,6 +1222,15 @@ public class CDebugTarget extends CDebugElement private void handleWatchpointScope( ICDIWatchpointScope ws ) { + CBreakpoint watchpoint = (CBreakpoint)findBreakpoint( ws.getWatchpoint() ); + try + { + removeBreakpoint( watchpoint ); + } + catch( DebugException e ) + { + CDebugCorePlugin.log( e ); + } fireSuspendEvent( DebugEvent.BREAKPOINT ); } @@ -1542,4 +1551,18 @@ public class CDebugTarget extends CDebugElement { return (ICDIBreakpoint)getBreakpoints().get( breakpoint ); } + + private IBreakpoint findBreakpoint( ICDIBreakpoint cdiBreakpoint ) + { + if ( cdiBreakpoint == null ) + return null; + Iterator it = getBreakpoints().keySet().iterator(); + while( it.hasNext() ) + { + IBreakpoint breakpoint = (IBreakpoint)it.next(); + if ( cdiBreakpoint.equals( getBreakpoints().get( breakpoint ) ) ) + return breakpoint; + } + return null; + } } diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java index b56f3cb5d99..07aa3c1b2cf 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java @@ -19,6 +19,7 @@ import org.eclipse.cdt.debug.core.IState; import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; import org.eclipse.cdt.debug.core.cdi.ICDIExitInfo; import org.eclipse.cdt.debug.core.cdi.ICDISignal; +import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointScope; import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.core.resources.IFile; @@ -303,6 +304,10 @@ public class CDTDebugModelPresentation extends LabelProvider ((ICDIWatchpointTrigger)info).getNewValue() } ); return label; } + if ( info != null && info instanceof ICDIWatchpointScope ) + { + return target.getName() + " (Watchpoint is out of scope)"; + } /* if ( info != null && info instanceof ICDIBreakpointHit ) {