Interface IBreakpoint
-
- All Superinterfaces:
IAdaptable
- All Known Subinterfaces:
ILineBreakpoint,IWatchpoint
- All Known Implementing Classes:
Breakpoint,LineBreakpoint
public interface IBreakpoint extends IAdaptable
A breakpoint is capable of suspending the execution of a program at a specific location when a program is running in debug mode. Each breakpoint has an associated marker which stores and persists all attributes associated with a breakpoint.A breakpoint is defined in two parts:
- By an extension of kind
"org.eclipse.debug.core.breakpoints" - By a marker definition that corresponds to the above breakpoint extension
For example, following is a definition of corresponding breakpoint and breakpoint marker definitions. Note that the
markerTypeattribute defined by the breakpoint extension corresponds to the type of the marker definition.<extension point="org.eclipse.debug.core.breakpoints"> <breakpoint id="com.example.Breakpoint" class="com.example.Breakpoint" markerType="com.example.BreakpointMarker"> </breakpoint> </extension> <extension point="org.eclipse.core.resources.markers"> <marker id="com.example.BreakpointMarker" super type="org.eclipse.debug.core.breakpointMarker" attribute name ="exampleAttribute"> </marker> </extension>The breakpoint manager instantiates persisted breakpoints by traversing all markers that are a subtype of
"org.eclipse.debug.core.breakpointMarker", and instantiating the class defined by theclassattribute on the associated breakpoint extension. The methodsetMarkeris then called to associate a marker with the breakpoint.Breakpoints may or may not be registered with the breakpoint manager, and are persisted and restored as such. Since marker definitions only allow all or none of a specific marker type to be persisted, breakpoints define a
PERSISTEDattribute for selective persistence of breakpoints of the same type.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringBREAKPOINT_MARKERRoot breakpoint marker type (value"org.eclipse.debug.core.breakpointMarker").static StringENABLEDEnabled breakpoint marker attribute (value"org.eclipse.debug.core.enabled").static StringIDDebug model identifier breakpoint marker attribute (value"org.eclipse.debug.core.id").static StringLINE_BREAKPOINT_MARKERLine breakpoint marker type (value"org.eclipse.debug.core.lineBreakpoint").static StringPERSISTEDPersisted breakpoint marker attribute (value"org.eclipse.debug.core.persisted").static StringREGISTEREDRegistered breakpoint marker attribute (value"org.eclipse.debug.core.registered").
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddelete()Deletes this breakpoint's underlying marker, and removes this breakpoint from the breakpoint manager.IMarkergetMarker()Returns the marker associated with this breakpoint, ornullif no marker is associated with this breakpoint.StringgetModelIdentifier()Returns the identifier of the debug model this breakpoint is associated with.booleanisEnabled()Returns whether this breakpoint is enabledbooleanisPersisted()Returns whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened.booleanisRegistered()Returns whether this breakpoint is currently registered with the breakpoint manager.voidsetEnabled(boolean enabled)Sets the enabled state of this breakpoint.voidsetMarker(IMarker marker)Sets the marker associated with this breakpoint.voidsetPersisted(boolean registered)Sets whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened.voidsetRegistered(boolean registered)Sets whether this breakpoint is currently registered with the breakpoint manager.-
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
-
-
-
Field Detail
-
BREAKPOINT_MARKER
static final String BREAKPOINT_MARKER
Root breakpoint marker type (value"org.eclipse.debug.core.breakpointMarker").
-
LINE_BREAKPOINT_MARKER
static final String LINE_BREAKPOINT_MARKER
Line breakpoint marker type (value"org.eclipse.debug.core.lineBreakpoint").
-
ENABLED
static final String ENABLED
Enabled breakpoint marker attribute (value"org.eclipse.debug.core.enabled"). The attribute is abooleancorresponding to the enabled state of a breakpoint.
-
ID
static final String ID
Debug model identifier breakpoint marker attribute (value"org.eclipse.debug.core.id"). The attribute is aStringcorresponding to the identifier of the debug model a breakpoint is associated with.- See Also:
- Constant Field Values
-
REGISTERED
static final String REGISTERED
Registered breakpoint marker attribute (value"org.eclipse.debug.core.registered"). The attribute is abooleancorresponding to whether a breakpoint has been registered with the breakpoint manager.
-
PERSISTED
static final String PERSISTED
Persisted breakpoint marker attribute (value"org.eclipse.debug.core.persisted"). The attribute is abooleancorresponding to whether a breakpoint is to be persisted across workspace invocations.
-
-
Method Detail
-
delete
void delete() throws CoreExceptionDeletes this breakpoint's underlying marker, and removes this breakpoint from the breakpoint manager.- Throws:
CoreException- if unable to delete this breakpoint's underlying marker
-
getMarker
IMarker getMarker()
Returns the marker associated with this breakpoint, ornullif no marker is associated with this breakpoint.- Returns:
- associated marker, or
nullif there is no associated marker.
-
setMarker
void setMarker(IMarker marker) throws CoreException
Sets the marker associated with this breakpoint. This method is called once at breakpoint creation.- Parameters:
marker- the marker to associate with this breakpoint- Throws:
CoreException- if an error occurs accessing the marker
-
getModelIdentifier
String getModelIdentifier()
Returns the identifier of the debug model this breakpoint is associated with.- Returns:
- the identifier of the debug model this breakpoint is associated with
-
isEnabled
boolean isEnabled() throws CoreExceptionReturns whether this breakpoint is enabled- Returns:
- whether this breakpoint is enabled
- Throws:
CoreException- if unable to access the associated attribute from this breakpoint's underlying marker
-
setEnabled
void setEnabled(boolean enabled) throws CoreExceptionSets the enabled state of this breakpoint. This has no effect if the current enabled state is the same as specified by the enabled parameter.- Parameters:
enabled- whether this breakpoint should be enabled- Throws:
CoreException- if unable to set the associated attribute on this breakpoint's underlying marker.
-
isRegistered
boolean isRegistered() throws CoreExceptionReturns whether this breakpoint is currently registered with the breakpoint manager.- Returns:
- whether this breakpoint is currently registered with the breakpoint manager
- Throws:
CoreException- if unable to access the associated attribute on this breakpoint's underlying marker
-
setRegistered
void setRegistered(boolean registered) throws CoreExceptionSets whether this breakpoint is currently registered with the breakpoint manager.- Parameters:
registered- whether this breakpoint is registered with the breakpoint manager- Throws:
CoreException- if unable to set the associated attribute on this breakpoint's underlying marker.
-
isPersisted
boolean isPersisted() throws CoreExceptionReturns whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened. Since marker definitions only allow all/none of a specific type of marker to be persisted (rather than selected markers of a specific type), breakpoints define this functionality.- Returns:
- whether this breakpoint is to be persisted
- Throws:
CoreException- if unable to access the associated attribute on this breakpoint's underlying marker
-
setPersisted
void setPersisted(boolean registered) throws CoreExceptionSets whether this breakpoint is to be persisted across workspace invocations, or when a project is closed and re-opened. Has no effect if this breakpoint's marker definition is defined as not persisted. Sets the underlyingTRANSIENTattribute on this breakpoint's marker totrue.- Parameters:
registered- whether this breakpoint is to be persisted across workspace invocations- Throws:
CoreException- if unable to set the associated attribute on this breakpoint's underlying marker.
-
-