Class Breakpoint.Builder

java.lang.Object
com.oracle.truffle.api.debug.Breakpoint.Builder
Enclosing class:
Breakpoint

public final class Breakpoint.Builder extends Object
Builder implementation for a new breakpoint.
Since:
0.17
See Also:
  • Method Details

    • lineIs

      public Breakpoint.Builder lineIs(int line)
      Specifies the breakpoint's line number. Can only be invoked once per builder. Cannot be used together with Breakpoint.newBuilder(SourceSection).
      Parameters:
      line - 1-based line number
      Throws:
      IllegalStateException - if line < 1
      Since:
      0.17
    • suspendAnchor

      public Breakpoint.Builder suspendAnchor(SuspendAnchor anchor)
      Specify the breakpoint suspension anchor within the guest language source location. By default, the breakpoint suspends before the source location.
      Parameters:
      anchor - the breakpoint suspension anchor
      Since:
      0.32
    • columnIs

      public Breakpoint.Builder columnIs(int column)
      Specifies the breakpoint's column number. Can only be invoked once per builder. Cannot be used together with Breakpoint.newBuilder(SourceSection). A line needs to be specified before a column can be set.
      Parameters:
      column - 1-based column number
      Throws:
      IllegalStateException - if column < 1
      Since:
      0.33
    • resolveListener

      public Breakpoint.Builder resolveListener(Breakpoint.ResolveListener resolveListener)
      Set a resolve listener. The listener is called when the breakpoint is resolved at the target location. A breakpoint is not resolved till the target source section is loaded. The target resolved location may differ from the specified line and column.
      Since:
      0.33
    • ignoreCount

      public Breakpoint.Builder ignoreCount(int ignoreCount)
      Specifies the number of times a breakpoint is ignored until it hits (i.e. suspends execution}.
      Since:
      0.17
      See Also:
    • oneShot

      public Breakpoint.Builder oneShot()
      Specifies that the breakpoint will disable itself after suspending execution, i.e. on first hit.

      Disabled one-shot breakpoints can be re-enabled.

      Since:
      0.17
    • sourceElements

      public Breakpoint.Builder sourceElements(SourceElement... sourceElements)
      Specifies which source elements will this breakpoint adhere to. When not specified, breakpoint adhere to SourceElement.STATEMENT elements. Can only be invoked once per builder.
      Parameters:
      sourceElements - a non-empty list of source elements
      Since:
      0.33
    • rootInstance

      public Breakpoint.Builder rootInstance(DebugValue rootInstance)
      Specifies the breakpoint's root instance. The breakpoint will be hit only when the DebugScope.getRootInstance() matches to the provided one.
      Parameters:
      rootInstance - value of the root instance in which the breakpoint is to be hit.
      Since:
      19.3.0
    • build

      public Breakpoint build()
      Returns:
      a new breakpoint instance of SOURCE_LOCATION kind.
      Since:
      0.17