Class DebugState.Builder
- java.lang.Object
-
- com.tonic.analysis.execution.debug.DebugState.Builder
-
- Enclosing class:
- DebugState
public static class DebugState.Builder extends Object
Mutable accumulator for the fields of aDebugState.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DebugStatebuild()DebugState.BuildercallDepth(int depth)DebugState.BuildercallStack(List<StackFrameInfo> stack)DebugState.BuildercurrentLine(int line)DebugState.BuildercurrentMethod(String method)DebugState.BuildercurrentPC(int pc)DebugState.BuilderhitBreakpoint(Breakpoint bp)DebugState.BuilderinstructionCount(long count)DebugState.Builderlocals(LocalsSnapshot locals)DebugState.BuilderoperandStack(StackSnapshot stack)DebugState.Builderstatus(DebugState.Status status)
-
-
-
Method Detail
-
status
public DebugState.Builder status(DebugState.Status status)
- Parameters:
status- execution status, defaulting to IDLE- Returns:
- this builder
-
currentMethod
public DebugState.Builder currentMethod(String method)
- Parameters:
method- identifier of the executing method- Returns:
- this builder
-
currentPC
public DebugState.Builder currentPC(int pc)
- Parameters:
pc- bytecode offset of the next instruction- Returns:
- this builder
-
currentLine
public DebugState.Builder currentLine(int line)
- Parameters:
line- source line, or -1 when unknown- Returns:
- this builder
-
callDepth
public DebugState.Builder callDepth(int depth)
- Parameters:
depth- number of frames on the call stack- Returns:
- this builder
-
instructionCount
public DebugState.Builder instructionCount(long count)
- Parameters:
count- instructions executed so far- Returns:
- this builder
-
hitBreakpoint
public DebugState.Builder hitBreakpoint(Breakpoint bp)
- Parameters:
bp- breakpoint that stopped execution, or null if none did- Returns:
- this builder
-
callStack
public DebugState.Builder callStack(List<StackFrameInfo> stack)
- Parameters:
stack- frames from innermost outward; copied at build time, null means empty- Returns:
- this builder
-
locals
public DebugState.Builder locals(LocalsSnapshot locals)
- Parameters:
locals- local variable snapshot of the current frame- Returns:
- this builder
-
operandStack
public DebugState.Builder operandStack(StackSnapshot stack)
- Parameters:
stack- operand stack snapshot of the current frame- Returns:
- this builder
-
build
public DebugState build()
- Returns:
- an immutable state snapshot, with the call stack defensively copied
-
-