public final class Breakpoint extends Object
DebuggerSession uses a Breakpoint.Builder to create a new breakpoint,
choosing among multiple ways to specify the intended location. Examples include a specified
source, a specified URI, line ranges, or an
exact SourceSection.
Example usage: BreakpointSnippets.example()
| Modifier and Type | Class and Description |
|---|---|
class |
Breakpoint.Builder
Builder implementation for a new
breakpoint. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Permanently prevents this breakpoint from affecting execution.
|
String |
getCondition()
Returns the expression used to create the current breakpoint condition, null if no condition
set.
|
int |
getHitCount() |
int |
getIgnoreCount() |
String |
getLocationDescription() |
boolean |
isDisposed() |
boolean |
isEnabled() |
boolean |
isOneShot() |
boolean |
isResolved() |
static Breakpoint.Builder |
newBuilder(Source source)
Creates a new breakpoint builder based on a
Source. |
static Breakpoint.Builder |
newBuilder(SourceSection sourceSection)
Creates a new breakpoint builder based on the textual region of a guest language syntactic
component.
|
static Breakpoint.Builder |
newBuilder(URI sourceUri)
Creates a new breakpoint builder based on a URI location.
|
void |
setCondition(String expression)
Assigns to this breakpoint a boolean expression whose evaluation will determine whether the
breakpoint suspends execution (i.e.
|
void |
setEnabled(boolean enabled)
Controls whether this breakpoint is currently allowed to suspend execution (true by default).
|
void |
setIgnoreCount(int ignoreCount)
Changes the number of times the breakpoint must be executed before it hits (i.e.
|
String |
toString() |
public boolean isDisposed()
Breakpoint.dispose()public boolean isEnabled()
Breakpoint.setEnabled(boolean)public void setEnabled(boolean enabled)
This can be changed arbitrarily until breakpoint is disposed.
enabled - whether this breakpoint should be allowed to suspend executionpublic boolean isResolved()
public void setCondition(String expression)
null to remove any condition and always
suspend.
Breakpoints are by default unconditional.
Evaluation: expressions are parsed and evaluated in the lexical context of the breakpoint's location. A conditional breakpoint that applies to multiple code locations will be parsed and evaluated separately for each location.
Evaluation failure: when evaluation of a condition fails for any reason, including the return of a non-boolean value:
true, andexpression - if non-null, a boolean expression, expressed in the guest language
of the breakpoint's location.SuspendedEvent.getBreakpointConditionException(Breakpoint)public String getCondition()
public void dispose()
public boolean isOneShot()
public int getIgnoreCount()
Breakpoint.setIgnoreCount(int)public void setIgnoreCount(int ignoreCount)
When a breakpoint condition evaluates to false:
ignoreCount does not change.ignoreCount - number of breakpoint activations to ignore before it hitspublic int getHitCount()
public String getLocationDescription()
public static Breakpoint.Builder newBuilder(URI sourceUri)
sourceUri - a URI to specify breakpoint locationpublic static Breakpoint.Builder newBuilder(Source source)
Source.source - a Source to specify breakpoint locationpublic static Breakpoint.Builder newBuilder(SourceSection sourceSection)
sourceSection - a specification for guest language syntactic component