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
* feat(dwarf): emit DWARF debug sections behind --debug-line (VCR-DBG-001, #242, #394)
PR B of v0.12.0: with `--debug-line`, synth emits a full DWARF unit
(`.debug_info`/`.debug_abbrev`/`.debug_str`/`.debug_line`) into the
relocatable ELF, mapping ARM `.text` addresses back to the input wasm's
source lines via PR A's per-instruction line_map.
Pipeline: read the input wasm's `.debug_line` (gimli, now a production dep of
synth-core — auto-resolved by Bazel via from_cargo), compose
`func_offset + machine_offset → op_offsets[op_idx] → op_offsets_to_source →
source line`, emit a real `DW_TAG_compile_unit` whose `DW_AT_stmt_list` points
at `.debug_line`, and add the sections as NON-ALLOC trailing PROGBITS (after
`.text`/`.data`/`.bss`, so the hardcoded `with_section(4/5/6)` symbol indices
are undisturbed).
Frozen-safe: the entire emit is behind `if debug_line` (default off), so the
default build is byte-identical. Oracles (dwarf_debug_line_emit_394.rs):
- additivity: on a DWARF input (msgq) `.text`/`.data`/`.bss` are
byte-identical with/without the flag and the `.debug_*` sections appear
only under it; on a no-DWARF input (gust_kernel) the whole `.o` is
byte-identical.
- reachability: the emitted DWARF is walked via the NORMAL gimli
`dwarf.units()` → CU `DW_AT_stmt_list` line-program path (the path a
debugger uses), resolving 110 in-range `.text` addresses to non-zero
source lines.
EXPERIMENTAL scope: addresses are object-relative (`.text` base 0) with no
`.rela.debug_*` yet, so they are correct for the unlinked object but shift by
the load base once linked. PR C (VCR-DBG-002) generalizes the elf_builder's
`.rel.text`-only relocation machinery to emit `.rela.debug_*` against the
`.text` symbol — required before v0.12.0 is tagged. ARM only; RISC-V is a
follow-up.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(bazel): list @crates//:gimli in synth-core deps (VCR-DBG-001, #394)
The hand-written rust_library `deps` in crates/BUILD.bazel are not generated
from Cargo.toml, so moving gimli to a production dependency of synth-core
(which cargo honours) left the Bazel target compiling synth-core without it →
`error[E0433]: unresolved crate gimli` in "Bazel Build & Proofs". from_cargo
makes the `@crates//:gimli` alias available; the manual target must still list
it. Verified `bazel build //crates:synth` green.
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments