org.eclipse.cdt.debug.internal.core.breakpoints
Class CBreakpoint

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.debug.core.model.Breakpoint
          extended by org.eclipse.cdt.debug.internal.core.breakpoints.CBreakpoint
All Implemented Interfaces:
ICBreakpoint, org.eclipse.core.runtime.IAdaptable, org.eclipse.debug.core.IDebugEventSetListener, org.eclipse.debug.core.model.IBreakpoint
Direct Known Subclasses:
AbstractLineBreakpoint, CWatchpoint

public abstract class CBreakpoint
extends org.eclipse.debug.core.model.Breakpoint
implements ICBreakpoint, org.eclipse.debug.core.IDebugEventSetListener

The base class for all C/C++ specific breakpoints.


Field Summary
 
Fields inherited from interface org.eclipse.cdt.debug.core.model.ICBreakpoint
CONDITION, IGNORE_COUNT, INSTALL_COUNT, MODULE, SOURCE_HANDLE, THREAD_ID
 
Fields inherited from interface org.eclipse.debug.core.model.IBreakpoint
BREAKPOINT_MARKER, ENABLED, ID, LINE_BREAKPOINT_MARKER, PERSISTED, REGISTERED
 
Constructor Summary
CBreakpoint()
          Constructor for CBreakpoint.
CBreakpoint(org.eclipse.core.resources.IResource resource, java.lang.String markerType, java.util.Map attributes, boolean add)
          Constructor for CBreakpoint.
 
Method Summary
 void createMarker(org.eclipse.core.resources.IResource resource, java.lang.String markerType, java.util.Map attributes, boolean add)
           
 int decrementInstallCount()
          Decrements the install count of this breakpoint.
 void fireChanged()
          Change notification when there are no marker changes.
 java.lang.String getCondition()
          Returns the conditional expression associated with this breakpoint.
 int getIgnoreCount()
          Returns the ignore count used by this breakpoint.
 int getInstallCount()
          Returns the INSTALL_COUNT attribute of this breakpoint or 0 if the attribute is not set.
 java.lang.String getModelIdentifier()
           
 java.lang.String getModule()
          Returns the module name this breakpoint is set in.
 java.lang.String getSourceHandle()
          Returns the source handle this breakpoint is set in.
 ICDebugTarget[] getTargetFilters()
          Returns all target filters set on this breakpoint.
 ICThread[] getThreadFilters(ICDebugTarget target)
          Returns the threads in the given target in which this breakpoint is enabled or null if this breakpoint is enabled in all threads in the given target.
 java.lang.String getThreadId()
          Returns the identifier of the thread this breakpoint is restricted in.
 void handleDebugEvents(org.eclipse.debug.core.DebugEvent[] events)
           
 int incrementInstallCount()
          Increments the install count of this breakpoint
 boolean isConditional()
          Returns whether this breakpoint is conditional.
 boolean isInstalled()
          Returns whether this breakpoint is installed in at least one debug target.
 void register(boolean register)
          Add this breakpoint to the breakpoint manager, or sets it as unregistered.
 void removeTargetFilter(ICDebugTarget target)
          Removes the given target from the breakpoint's target list.
 void removeThreadFilters(ICThread[] threads)
          Removes this breakpoint's thread filters in the given target, if any.
 void resetInstallCount()
          Resets the install count of this breakpoint
 void setCondition(java.lang.String condition)
          Sets the condition associated with this breakpoint.
 void setIgnoreCount(int ignoreCount)
          Sets the ignore count attribute for this breakpoint.
 void setModule(java.lang.String module)
          Sets the module name of this breakpoint.
 void setSourceHandle(java.lang.String sourceHandle)
          Sets the source handle of this breakpoint.
 void setTargetFilter(ICDebugTarget target)
          Add the given target to the list of this breakpoint's targets.
 void setThreadFilters(ICThread[] threads)
          Restricts this breakpoint to suspend only in the given threads when encounterd in the given threads' target.
 void setThreadId(java.lang.String threadId)
          Restricts this breakpoint to suspend only in the given thread when encounterd in the given thread's target.
 
Methods inherited from class org.eclipse.debug.core.model.Breakpoint
delete, equals, getMarker, hashCode, isEnabled, isPersisted, isRegistered, setEnabled, setMarker, setPersisted, setRegistered
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.debug.core.model.IBreakpoint
delete, getMarker, isEnabled, isPersisted, isRegistered, setEnabled, setMarker, setPersisted, setRegistered
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

CBreakpoint

public CBreakpoint()
Constructor for CBreakpoint.


CBreakpoint

public CBreakpoint(org.eclipse.core.resources.IResource resource,
                   java.lang.String markerType,
                   java.util.Map attributes,
                   boolean add)
            throws org.eclipse.core.runtime.CoreException
Constructor for CBreakpoint.

Throws:
org.eclipse.core.runtime.CoreException
Method Detail

createMarker

public void createMarker(org.eclipse.core.resources.IResource resource,
                         java.lang.String markerType,
                         java.util.Map attributes,
                         boolean add)
                  throws org.eclipse.debug.core.DebugException
Throws:
org.eclipse.debug.core.DebugException

getModelIdentifier

public java.lang.String getModelIdentifier()
Specified by:
getModelIdentifier in interface org.eclipse.debug.core.model.IBreakpoint

isInstalled

public boolean isInstalled()
                    throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns whether this breakpoint is installed in at least one debug target.

Specified by:
isInstalled in interface ICBreakpoint
Returns:
whether this breakpoint is installed
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

getCondition

public java.lang.String getCondition()
                              throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns the conditional expression associated with this breakpoint.

Specified by:
getCondition in interface ICBreakpoint
Returns:
this breakpoint's conditional expression
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

setCondition

public void setCondition(java.lang.String condition)
                  throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Sets the condition associated with this breakpoint.

Specified by:
setCondition in interface ICBreakpoint
Parameters:
condition - the conditional expression
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

getIgnoreCount

public int getIgnoreCount()
                   throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns the ignore count used by this breakpoint.

Specified by:
getIgnoreCount in interface ICBreakpoint
Returns:
the ignore count used by this breakpoint
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

setIgnoreCount

public void setIgnoreCount(int ignoreCount)
                    throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Sets the ignore count attribute for this breakpoint.

Specified by:
setIgnoreCount in interface ICBreakpoint
Parameters:
ignoreCount - the new ignore count
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

getThreadId

public java.lang.String getThreadId()
                             throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns the identifier of the thread this breakpoint is restricted in.

Specified by:
getThreadId in interface ICBreakpoint
Returns:
the thread identifier
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

setThreadId

public void setThreadId(java.lang.String threadId)
                 throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Restricts this breakpoint to suspend only in the given thread when encounterd in the given thread's target.

Specified by:
setThreadId in interface ICBreakpoint
Parameters:
threadId - the thread identifier
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

getSourceHandle

public java.lang.String getSourceHandle()
                                 throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns the source handle this breakpoint is set in.

Specified by:
getSourceHandle in interface ICBreakpoint
Returns:
the source handle
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

setSourceHandle

public void setSourceHandle(java.lang.String sourceHandle)
                     throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Sets the source handle of this breakpoint.

Specified by:
setSourceHandle in interface ICBreakpoint
Parameters:
sourceHandle - the source handle
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

handleDebugEvents

public void handleDebugEvents(org.eclipse.debug.core.DebugEvent[] events)
Specified by:
handleDebugEvents in interface org.eclipse.debug.core.IDebugEventSetListener

register

public void register(boolean register)
              throws org.eclipse.core.runtime.CoreException
Add this breakpoint to the breakpoint manager, or sets it as unregistered.

Throws:
org.eclipse.core.runtime.CoreException

resetInstallCount

public void resetInstallCount()
                       throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Resets the install count of this breakpoint

Specified by:
resetInstallCount in interface ICBreakpoint
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

incrementInstallCount

public int incrementInstallCount()
                          throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Increments the install count of this breakpoint

Specified by:
incrementInstallCount in interface ICBreakpoint
Returns:
the new install count value
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

getInstallCount

public int getInstallCount()
                    throws org.eclipse.core.runtime.CoreException
Returns the INSTALL_COUNT attribute of this breakpoint or 0 if the attribute is not set.

Throws:
org.eclipse.core.runtime.CoreException

decrementInstallCount

public int decrementInstallCount()
                          throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Decrements the install count of this breakpoint.

Specified by:
decrementInstallCount in interface ICBreakpoint
Returns:
the new install caount value
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

isConditional

public boolean isConditional()
                      throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns whether this breakpoint is conditional.

Specified by:
isConditional in interface ICBreakpoint
Returns:
whether this breakpoint is conditional
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

getTargetFilters

public ICDebugTarget[] getTargetFilters()
                                 throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns all target filters set on this breakpoint.

Specified by:
getTargetFilters in interface ICBreakpoint
Returns:
the targets that this breakpoint is resticted to
Throws:
org.eclipse.core.runtime.CoreException - if unable to determine this breakpoint's target filters

getThreadFilters

public ICThread[] getThreadFilters(ICDebugTarget target)
                            throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns the threads in the given target in which this breakpoint is enabled or null if this breakpoint is enabled in all threads in the given target.

Specified by:
getThreadFilters in interface ICBreakpoint
Returns:
the threads in the given target that this breakpoint is enabled for
Throws:
org.eclipse.core.runtime.CoreException - if unable to determine this breakpoint's thread filters

removeTargetFilter

public void removeTargetFilter(ICDebugTarget target)
                        throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Removes the given target from the breakpoint's target list. The breakpoint has no effect in the given target.

Specified by:
removeTargetFilter in interface ICBreakpoint
Parameters:
target - the target filter to be removed
Throws:
org.eclipse.core.runtime.CoreException - if unable to remove the target filter

removeThreadFilters

public void removeThreadFilters(ICThread[] threads)
                         throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Removes this breakpoint's thread filters in the given target, if any. Has no effect if this breakpoint does not have filters in the given target. All threads must be from the same target.

Specified by:
removeThreadFilters in interface ICBreakpoint
Parameters:
threads - the thread filters to be removed
Throws:
org.eclipse.core.runtime.CoreException - if unable to remove the thread filter

setTargetFilter

public void setTargetFilter(ICDebugTarget target)
                     throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Add the given target to the list of this breakpoint's targets. Target filters are not persisted across workbench invocations.

Specified by:
setTargetFilter in interface ICBreakpoint
Parameters:
target - the target to add to the list of this breakpoint's targets.
Throws:
org.eclipse.core.runtime.CoreException - if unable to set the target filter

setThreadFilters

public void setThreadFilters(ICThread[] threads)
                      throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Restricts this breakpoint to suspend only in the given threads when encounterd in the given threads' target. All threads must be from the same target. Thread filters are not persisted across workbench invocations.

Specified by:
setThreadFilters in interface ICBreakpoint
Parameters:
threads - the thread filters to be set
Throws:
org.eclipse.core.runtime.CoreException - if unable to set the thread filters

fireChanged

public void fireChanged()
Change notification when there are no marker changes. If the marker does not exist, do not fire a change notificaiton (the marker may not exist if the associated project was closed).


getModule

public java.lang.String getModule()
                           throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Returns the module name this breakpoint is set in.

Specified by:
getModule in interface ICBreakpoint
Returns:
the module name
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker

setModule

public void setModule(java.lang.String module)
               throws org.eclipse.core.runtime.CoreException
Description copied from interface: ICBreakpoint
Sets the module name of this breakpoint.

Specified by:
setModule in interface ICBreakpoint
Parameters:
module - the module name
Throws:
org.eclipse.core.runtime.CoreException - if unable to access the property on this breakpoint's underlying marker