Expand description
anchor debugger — a foundry-style SBF instruction stepper built on the
same per-test register traces that --profile consumes for flamegraphs.
§Flow
- The caller invokes the existing
anchor test --profilepipeline, which leaves traces undertarget/anchor-v2-profile/<test>/. runwalks 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
DebugSessionthe 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_diron some builds, leaving entries likesrc/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 anAnchor.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 debuggerTUI.
Functions§
- loose_
profile_ dir_ name - Default trace directory name (relative to the workspace root). Mirrors
crate::profile::DEFAULT_PROFILE_DIRso the loose-mode flow agrees with the Anchor.toml-driven flow on where to read/write traces. - run
- Build a
model::DebugSessionfrom the profile trace directory and launch the TUI. Blocks until the user quits.