Skip to main content

Module debugger

Module debugger 

Source
Expand description

anchor debugger — a foundry-style SBF instruction stepper built on the same per-test register traces that --profile consumes for flamegraphs.

§Flow

  1. The caller invokes the existing anchor test --profile pipeline, which leaves traces under target/anchor-v2-profile/<test>/.
  2. run walks that directory, materializes a [DebugSession], and launches the TUI.

Keeping the trace-producing half identical to --profile means the debugger and flamegraph don’t drift: any improvement to the trace pipeline is picked up by both.

Modules§

arena
Walks the profile trace directory and materializes the DebugSession the TUI consumes.
cargo_deps
Discover dependency source trees so the TUI can read files whose DWARF paths were emitted relative to each crate’s compile dir (cargo strips DW_AT_comp_dir on some builds, leaving entries like src/cpi.rs).
gdb
GDB-driven trace capture for anchor debugger --gdb.
highlight
Syntax highlighting for the source + instruction panes.
loose
“Loose” mode for anchor debugger — runs in any cargo workspace without requiring an Anchor.toml.
model
Data model consumed by the debugger TUI.
path_label
Classify a resolved source path into a human-readable label for the source pane title.
rustc_wrapper
RUSTC_WRAPPER shim that restores absolute paths in SBF DWARF output.
source
DWARF-backed PC → (file, line) resolver for SBF ELFs.
tui
anchor debugger TUI.

Functions§

loose_profile_dir_name
Default trace directory name (relative to the workspace root). Mirrors crate::profile::DEFAULT_PROFILE_DIR so the loose-mode flow agrees with the Anchor.toml-driven flow on where to read/write traces.
run
Build a model::DebugSession from the profile trace directory and launch the TUI. Blocks until the user quits.