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 gatherFibersThen 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 gatherFibersThen(fibersProvider: () -> Collection<A_Fiber>, then: () -> Unit)

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 singleStep(fiber: A_Fiber)

Allow the specified fiber to execute exactly one nybblecode. 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
Link copied to clipboard