Skip to content

Commit 9c4c005

Browse files
avrabeclaude
andauthored
fix(dwarf): adapt LineProgram::new to gimli 0.33 6-arg signature (#436 fallout) (#439)
Dependabot #436 bumped gimli 0.31→0.33, which inserted a `source_dir: Option<LineString>` parameter into `LineProgram::new` (now 6 args: working_dir, source_dir, source_file, source_file_info). Both emit call sites still passed the 0.31 5-arg form, so main failed to compile (E0061) — a semantic break that VCR-DBG-001 PR C's CI could not catch because PR C branched before #436 and ran against the 0.31 lockfile, and GitHub's merge is textual, not semantic. Fix both call sites (the production emitter + the step-4 roundtrip test) with source_dir = None (file sits in working_dir, matching prior single-dir behaviour). The Writer trait / Address API is unchanged in 0.33, so the RelocWriter and relocation capture are unaffected. Verified: workspace builds, clippy --all-targets clean, all 4 dwarf_debug_line_emit_394 oracles + the step-4 roundtrip green against gimli 0.33. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9a34c8d commit 9c4c005

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

crates/synth-core/src/dwarf_line.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,14 @@ pub fn emit_debug_sections(table: &[(u64, u32)], text_sym: usize) -> Vec<Emitted
206206
// high_pc one past the last mapped address.
207207
let high_pc = table.iter().map(|&(a, _)| a).max().unwrap_or(0) + 1;
208208

209+
// gimli 0.33 split the comp-dir/file args: (working_dir, source_dir,
210+
// source_file, source_file_info). source_dir = None ⇒ the file sits in
211+
// working_dir, matching the previous single-dir behaviour.
209212
let mut program = LineProgram::new(
210213
encoding,
211214
gimli::LineEncoding::default(),
212215
LineString::String(b"/synth".to_vec()),
216+
None,
213217
LineString::String(b"synth.wasm".to_vec()),
214218
None,
215219
);

crates/synth-core/tests/dwarf_emit_roundtrip_step4.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ fn emit_dwarf(table: &[(u64, u32)]) -> HashMap<String, Vec<u8>> {
8888
address_size: 4,
8989
};
9090
let mut dwarf = DwarfUnit::new(encoding);
91+
// gimli 0.33: (working_dir, source_dir, source_file, source_file_info).
9192
let mut program = LineProgram::new(
9293
encoding,
9394
gimli::LineEncoding::default(),
9495
LineString::String(b"/synth".to_vec()),
96+
None,
9597
LineString::String(b"dwarf_coherent.rs".to_vec()),
9698
None,
9799
);

0 commit comments

Comments
 (0)