AvailDebuggerModel

class AvailDebuggerModel(val runtime: AvailRuntime)

AvailDebuggerModel controls the execution of a set of fibers, allowing exploration of the fibers' state. A separate user interface should drive this model.

Author

Mark van Gulik

Constructors

Link copied to clipboard
constructor(runtime: AvailRuntime)

Construct a new AvailDebuggerModel.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

This gets set by gatherFibers to the List of all A_Fibers that have not yet been captured by other debuggers. The fibers likewise get a reference to this debugger, so they can determine how/whether to run during stepping operations.

Link copied to clipboard

The AvailRuntime in which the debugged fibers are running.

Link copied to clipboard

A publicly accessible list of functions to call when a new fiber is to be added to the list of tracked fibers.

Link copied to clipboard

A publicly accessible list of functions to call when a fiber has reached its pause condition.

Functions

Link copied to clipboard
fun doSingleStep(fiber: A_Fiber, selectedContinuation: A_Continuation)

An action to execute exactly one L1 instruction, the smallest unit of execution. Ignore the selected continuation.

Link copied to clipboard
fun doStepOver(fiber: A_Fiber, selectedContinuation: A_Continuation)

An action to execute at least one L1 instruction, stopping only when the selected frame is at the top of the stack again, or has been removed from the stack through a return or other means.

Link copied to clipboard
fun gatherFibers(fibersProvider: () -> Collection<A_Fiber>)

For every existing fiber that isn't already captured by another debugger, bind that fiber to this debugger. Those fibers are not permitted to run unless this debugger says they may. Any fibers launched after this point (say, to compute a print representation or evaluate an expression) will not be captured by this debugger.

Link copied to clipboard
Link copied to clipboard

Determine whether the current capture function hook for the runtime is for this debugger.

Link copied to clipboard
fun justPaused(fiber: A_Fiber)

The given fiber just reached the pause condition, and has transitioned to the PAUSED state. Enter a safe point and invoke each whenPausedActions.

Link copied to clipboard
fun releaseFibersThen(then: () -> Unit)

Enter a safe point, then for each captured fiber, un-capture it, and unpause it if it was paused for the debugger. After all fibers have been released, invoke the callback, still within the safe point.

Link copied to clipboard
Link copied to clipboard
fun resume(fiber: A_Fiber)
Link copied to clipboard
fun runFiberAction(fiber: A_Fiber, selectedContinuation: A_Continuation, doAction: AvailDebuggerModel.(A_Fiber, A_Continuation) -> Unit)

Allow the specified fiber to run in some way until some condition is met. Supersede any existing run/step mode for this fiber. We must be in a safe point to change this mode.

Link copied to clipboard
Link copied to clipboard