Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7bf9b8e

Browse files
committed
Update gimli
1 parent 98dae86 commit 7bf9b8e

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/debuginfo.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> {
135135
root.set(gimli::DW_AT_comp_dir, AttributeValue::StringRef(comp_dir));
136136
root.set(
137137
gimli::DW_AT_low_pc,
138-
AttributeValue::Address(Address::Absolute(0)),
138+
AttributeValue::Address(Address::Constant(0)),
139139
);
140140
}
141141

@@ -251,7 +251,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
251251

252252
entry.set(
253253
gimli::DW_AT_low_pc,
254-
AttributeValue::Address(Address::Relative { symbol, addend: 0 }),
254+
AttributeValue::Address(Address::Symbol { symbol, addend: 0 }),
255255
);
256256

257257
debug_context.emit_location(tcx, entry_id, mir.span);
@@ -273,7 +273,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
273273
) {
274274
let line_program = &mut self.debug_context.dwarf.unit.line_program;
275275

276-
line_program.begin_sequence(Some(Address::Relative {
276+
line_program.begin_sequence(Some(Address::Symbol {
277277
symbol: self.symbol,
278278
addend: 0,
279279
}));
@@ -326,7 +326,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
326326
.unit_range_list
327327
.0
328328
.push(Range::StartLength {
329-
begin: Address::Relative {
329+
begin: Address::Symbol {
330330
symbol: self.symbol,
331331
addend: 0,
332332
},
@@ -371,20 +371,22 @@ impl Writer for WriterRelocate {
371371

372372
fn write_address(&mut self, address: Address, size: u8) -> Result<()> {
373373
match address {
374-
Address::Absolute(val) => self.write_word(val, size),
375-
Address::Relative { symbol, addend } => {
374+
Address::Constant(val) => self.write_udata(val, size),
375+
Address::Symbol { symbol, addend } => {
376376
let offset = self.len() as u64;
377377
self.relocs.push(DebugReloc {
378378
offset: offset as u32,
379379
size,
380380
name: DebugRelocName::Symbol(symbol),
381381
addend: addend as i64,
382382
});
383-
self.write_word(0, size)
383+
self.write_udata(0, size)
384384
}
385385
}
386386
}
387387

388+
// TODO: implement write_eh_pointer
389+
388390
fn write_offset(&mut self, val: usize, section: SectionId, size: u8) -> Result<()> {
389391
let offset = self.len() as u32;
390392
self.relocs.push(DebugReloc {
@@ -393,7 +395,7 @@ impl Writer for WriterRelocate {
393395
name: DebugRelocName::Section(section),
394396
addend: val as i64,
395397
});
396-
self.write_word(0, size)
398+
self.write_udata(0, size)
397399
}
398400

399401
fn write_offset_at(
@@ -409,6 +411,6 @@ impl Writer for WriterRelocate {
409411
name: DebugRelocName::Section(section),
410412
addend: val as i64,
411413
});
412-
self.write_word_at(offset, 0, size)
414+
self.write_udata_at(offset, 0, size)
413415
}
414416
}

0 commit comments

Comments
 (0)