You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Debug Soroban contracts at the Rust level: a new "Variables" scope resolves
named locals/params with their types and values, expandable for structs, enums,
slices and strings — driven by the contract wasm's DWARF, replacing the raw
wasm locals/stack view.
New pure DWARF subsystem under src/dwarf/:
- forms.ts / die.ts: value-returning form reader + full DIE-tree parse with a
global offset index (CU-relative and cross-CU ref resolution).
- TypeRegistry.ts: lazy, cycle-safe decoded type model (base/pointer/struct/
union/array/enum/Rust variant_part enums/typedef/qualifier).
- locexpr.ts / debugLoc.ts: DWARF location/expression evaluator
(DW_OP_WASM_location incl. the kind-3 fixed-u32 case, DW_OP_fbreg via the
frame base, addr/plus_uconst/stack_value) + v4 .debug_loc selection.
- ScopeIndex.ts: PC -> function -> in-scope variables (high_pc-as-size,
lexical-block ranges, .debug_ranges).
- ValueDecoder.ts: type-aware value + lazy children, with &str/slice/Option
recognition, budgets and cycle guards; never throws.
- DebugInfo.ts: fromWasm facade, mirroring DwarfLineTable.
Runtime + wiring:
- trace.ts consumes komet-node's new per-step linear-memory snapshots (hex
sparse runs; null = unchanged) and globals; MemoryImage reconstructs memory
at any replay cursor; runtimeState bridges a record to the DWARF evaluator.
- VariableResolver (Dwarf/Null) mirrors the SourceMapper split; threaded
through buildDebugArtifacts and both backends; SorobanDebugSession exposes
the source Variables scope with lazily-expandable children.
Performance: the wasm uploaded to komet-node is now debug-stripped
(stripDebugSections) — carrying DWARF into the executed module bloated the KORE
config ~3x and stalled the RPC path; the code section is byte-identical so trace
positions still align with the full DWARF used for resolution.
Tested per module (unit) plus end-to-end variable inspection over a real komet
trace: dapMemoryVariables and the TurnkeyPipeline mock-node test both resolve a
shadow-stack parameter (by: u32 == 5) from linear memory; a gated live test
(KOMET_NODE_E2E) covers the full stack against a real komet-node.
0 commit comments