Package org.eclipse.jdt.debug.core
Interface IJavaBreakpoint
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable,org.eclipse.debug.core.model.IBreakpoint,org.eclipse.debug.core.model.ITriggerPoint
- All Known Subinterfaces:
IJavaClassPrepareBreakpoint,IJavaExceptionBreakpoint,IJavaLineBreakpoint,IJavaMethodBreakpoint,IJavaMethodEntryBreakpoint,IJavaPatternBreakpoint,IJavaStratumLineBreakpoint,IJavaTargetPatternBreakpoint,IJavaWatchpoint
public interface IJavaBreakpoint
extends org.eclipse.debug.core.model.IBreakpoint, org.eclipse.debug.core.model.ITriggerPoint
A breakpoint specific to the Java debug model. A Java breakpoint supports:
- a hit count
- a suspend policy that determines if the entire VM or a single thread is suspended when hit
- a thread filter to restrict a breakpoint to a specific thread within a VM
- an installed property that indicates a breakpoint was successfully installed in a VM
- Since:
- 2.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSuspend policy constant indicating a breakpoint will not suspend the target VM when hit.static final intDefault suspend policy constant indicating a breakpoint will suspend only the thread in which it occurred.static final intSuspend policy constant indicating a breakpoint will suspend the target VM when hit.Fields inherited from interface org.eclipse.debug.core.model.IBreakpoint
BREAKPOINT_MARKER, ENABLED, ID, LINE_BREAKPOINT_MARKER, PERSISTED, REGISTEREDFields inherited from interface org.eclipse.debug.core.model.ITriggerPoint
TRIGGERPOINT -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBreakpointListener(String identifier) Adds the breakpoint listener extension with specified identifier to this breakpoint.voidaddInstanceFilter(IJavaObject object) Adds the given object to the list of objects in which this breakpoint is restricted to suspend execution.String[]Returns a collection of identifiers of breakpoint listener extensions registered for this breakpoint, possibly empty.intReturns this breakpoint's hit count or, -1 if this breakpoint does not have a hit count.Returns the current set of active instance filters.intReturns the suspend policy used by this breakpoint, one ofSUSPEND_VMorSUSPEND_THREAD.getThreadFilter(IJavaDebugTarget target) Returns the thread in the given target in which this breakpoint is enabled ornullif this breakpoint is enabled in all threads in the given target.Returns all thread filters set on this breakpoint.Returns the fully qualified name of the type this breakpoint is located in, ornullif this breakpoint is not located in a specific type - for example, a pattern breakpoint.booleanReturns whether the breakpoint should disable on hit or not.booleanReturns whether this breakpoint is installed in at least one debug target.booleanremoveBreakpointListener(String identifier) Removes the breakpoint listener extension with the specified identifier from this breakpoint and returns whether the listener was removed.voidremoveInstanceFilter(IJavaObject object) Removes the given object from the list of objects in which this breakpoint is restricted to suspend execution.voidremoveThreadFilter(IJavaDebugTarget target) Removes this breakpoint's thread filter in the given target, if any.voidsetDisableOnHit(boolean disable) Sets whether the breakpoint should disable on hit or notvoidsetHitCount(int count) Sets the hit count attribute of this breakpoint.voidsetSuspendPolicy(int suspendPolicy) Sets whether all threads in the target VM will be suspended when this breakpoint is hit.voidsetThreadFilter(IJavaThread thread) Restricts this breakpoint to suspend only in the given thread when encountered in the given thread's target.booleanReturns whether this breakpoints supports instance filters.booleanReturns whether this breakpoints supports thread filters.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapterMethods inherited from interface org.eclipse.debug.core.model.IBreakpoint
delete, getMarker, getModelIdentifier, isEnabled, isPersisted, isRegistered, setEnabled, setMarker, setPersisted, setRegisteredMethods inherited from interface org.eclipse.debug.core.model.ITriggerPoint
isTriggerPoint, setTriggerPoint
-
Field Details
-
SUSPEND_VM
static final int SUSPEND_VMSuspend policy constant indicating a breakpoint will suspend the target VM when hit.- See Also:
-
SUSPEND_THREAD
static final int SUSPEND_THREADDefault suspend policy constant indicating a breakpoint will suspend only the thread in which it occurred.- See Also:
-
RESUME_ON_HIT
static final int RESUME_ON_HITSuspend policy constant indicating a breakpoint will not suspend the target VM when hit.- Since:
- 3.23
- See Also:
-
-
Method Details
-
isInstalled
boolean isInstalled() throws org.eclipse.core.runtime.CoreExceptionReturns whether this breakpoint is installed in at least one debug target.- Returns:
- whether this breakpoint is installed
- Throws:
org.eclipse.core.runtime.CoreException- if unable to access the property on this breakpoint's underlying marker
-
getTypeName
Returns the fully qualified name of the type this breakpoint is located in, ornullif this breakpoint is not located in a specific type - for example, a pattern breakpoint.- Returns:
- the fully qualified name of the type this breakpoint is located
in, or
null - Throws:
org.eclipse.core.runtime.CoreException- if unable to access the property from this breakpoint's underlying marker
-
getHitCount
int getHitCount() throws org.eclipse.core.runtime.CoreExceptionReturns this breakpoint's hit count or, -1 if this breakpoint does not have a hit count.- Returns:
- this breakpoint's hit count, or -1
- Throws:
org.eclipse.core.runtime.CoreException- if unable to access the property from this breakpoint's underlying marker
-
setHitCount
void setHitCount(int count) throws org.eclipse.core.runtime.CoreException Sets the hit count attribute of this breakpoint. If this breakpoint is currently disabled and the hit count is set greater than -1, this breakpoint is automatically enabled.- Parameters:
count- the new hit count- Throws:
org.eclipse.core.runtime.CoreException- if unable to set the property on this breakpoint's underlying marker
-
setSuspendPolicy
void setSuspendPolicy(int suspendPolicy) throws org.eclipse.core.runtime.CoreException Sets whether all threads in the target VM will be suspended when this breakpoint is hit. WhenSUSPEND_VMthe target VM is suspended, and whenSUSPEND_THREADonly the thread in which this breakpoint occurred is suspended.- Parameters:
suspendPolicy- one ofSUSPEND_VMorSUSPEND_THREAD- Throws:
org.eclipse.core.runtime.CoreException- if unable to set the property on this breakpoint's underlying marker
-
getSuspendPolicy
int getSuspendPolicy() throws org.eclipse.core.runtime.CoreExceptionReturns the suspend policy used by this breakpoint, one ofSUSPEND_VMorSUSPEND_THREAD.- Returns:
- one of
SUSPEND_VMorSUSPEND_THREAD - Throws:
org.eclipse.core.runtime.CoreException- if unable to access the property from this breakpoint's underlying marker
-
setThreadFilter
Restricts this breakpoint to suspend only in the given thread when encountered in the given thread's target. A breakpoint can only be restricted to one thread per target. Any previous thread filter for the same target is lost. A thread filter is not persisted across workbench invocations.- Parameters:
thread- the thread to add the filter to- Throws:
org.eclipse.core.runtime.CoreException- if unable to set the thread filter
-
removeThreadFilter
Removes this breakpoint's thread filter in the given target, if any. Has no effect if this breakpoint does not have a filter in the given target.- Parameters:
target- the target whose thread filter will be removed- Throws:
org.eclipse.core.runtime.CoreException- if unable to remove the thread filter
-
getThreadFilter
Returns the thread in the given target in which this breakpoint is enabled ornullif this breakpoint is enabled in all threads in the given target.- Parameters:
target- the debug target- Returns:
- the thread in the given target that this breakpoint is enabled for
- Throws:
org.eclipse.core.runtime.CoreException- if unable to determine this breakpoint's thread filter
-
getThreadFilters
Returns all thread filters set on this breakpoint.- Returns:
- the threads that this breakpoint is restricted to
- Throws:
org.eclipse.core.runtime.CoreException- if unable to determine this breakpoint's thread filters
-
addInstanceFilter
Adds the given object to the list of objects in which this breakpoint is restricted to suspend execution. Has no effect if the object has already been added. Note that clients should first ensure that a breakpoint supports instance filters.Note: This implementation will add more than one filter. However, if there is more than one instance filter for a debug target, the breakpoint will never be hit in that target, as the current context cannot be two different instances at the same time.
- Parameters:
object- instance filter to add- Throws:
org.eclipse.core.runtime.CoreException- if unable to add the given instance filter- Since:
- 2.1
-
removeInstanceFilter
Removes the given object from the list of objects in which this breakpoint is restricted to suspend execution. Has no effect if the object has not yet been added as an instance filter.- Parameters:
object- instance filter to remove- Throws:
org.eclipse.core.runtime.CoreException- if unable to remove the given instance filter- Since:
- 2.1
-
supportsInstanceFilters
boolean supportsInstanceFilters()Returns whether this breakpoints supports instance filters.- Returns:
- whether this breakpoints supports instance filters
- Since:
- 3.0
-
getInstanceFilters
Returns the current set of active instance filters.- Returns:
- the current set of active instance filters.
- Throws:
org.eclipse.core.runtime.CoreException- if unable to retrieve the list- Since:
- 2.1
-
supportsThreadFilters
boolean supportsThreadFilters()Returns whether this breakpoints supports thread filters.- Returns:
- whether this breakpoints supports thread filters
- Since:
- 3.0
-
getBreakpointListeners
Returns a collection of identifiers of breakpoint listener extensions registered for this breakpoint, possibly empty.- Returns:
- breakpoint listener extension identifiers registered on this breakpoint
- Throws:
org.eclipse.core.runtime.CoreException- if unable to retrieve the collection- Since:
- 3.5
-
addBreakpointListener
Adds the breakpoint listener extension with specified identifier to this breakpoint. Has no effect if an identical listener is already registered.- Parameters:
identifier- breakpoint listener extension identifier- Throws:
org.eclipse.core.runtime.CoreException- if unable to add the listener- Since:
- 3.5
-
removeBreakpointListener
Removes the breakpoint listener extension with the specified identifier from this breakpoint and returns whether the listener was removed.- Parameters:
identifier- breakpoint listener extension identifier- Returns:
- whether the listener was removed
- Throws:
org.eclipse.core.runtime.CoreException- if an error occurs removing the listener- Since:
- 3.5
-
isDisableOnHit
boolean isDisableOnHit()Returns whether the breakpoint should disable on hit or not.- Returns:
- whether the breakpoint should disable on hit or not.
- Since:
- 3.23
-
setDisableOnHit
void setDisableOnHit(boolean disable) Sets whether the breakpoint should disable on hit or not- Since:
- 3.23
-