Skip to main content

Module debug

Module debug 

Source
Expand description

Event handlers backing the miden::core::debug print-debugging module.

Each miden::core::debug::print_* procedure emits a well-known event. This module registers a single DebugPrinter handler for all of those events; when one fires, the handler reads the requested piece of VM state (operand stack, memory, advice stack, or advice map) and prints it using the VM’s tree-style debug formatting via miden_processor::write_stack / miden_processor::write_interval. A range-based procedure may share an event with its full-state variant when the full-state behavior can be represented as an unbounded range (e.g. the advice stack); memory uses a dedicated full-state event because print_mem enumerates its (capped) range while print_mem_all lists only initialized cells.

These are ordinary emit events: they carry no MAST/decorator cost and print whenever the procedure is executed.

Structs§

DebugPrinter
Handles all miden::core::debug::print_* events by printing VM state to its writer.

Constants§

PRINT_ADV_MAP_EVENT_NAME
Prints the full advice map.
PRINT_ADV_MAP_ITEM_EVENT_NAME
Looks up a WORD key in the advice map and prints the associated values.
PRINT_ADV_STACK_EVENT_NAME
Prints the advice stack in the range [start, end).
PRINT_MEM_ALL_EVENT_NAME
Prints the entire memory of the current context.
PRINT_MEM_EVENT_NAME
Prints memory in the range [start, end) of the current context.
PRINT_STACK_EVENT_NAME
Prints the entire operand stack.

Functions§

advice_debug_handlers
Returns the opt-in (EventName, handler) pairs for advice-backed debug events.
debug_handlers
Returns the (EventName, handler) pairs that back the full miden::core::debug module.
default_debug_handlers
Returns the default (EventName, handler) pairs for print-style debugging.
noop_debug_handlers
Returns no-op handlers for every miden::core::debug print event.