authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-10-19 00:24:36+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2023-10-19 21:56:47+02:00
logeb76ef58f80dffcba426b4668e9d658f10c00cb7
tree5f7b099a18ff09e3594eaa3f30188059f0b45585
parent400faec10beed6c146bc562efab146be258471d7

dwarf: revert adding spurious and incorrect +1 to getDebugInfoEnd()


1 files changed, 2 insertions(+), 2 deletions(-)

src/link/Dwarf.zig+2-2
...@@ -1823,7 +1823,7 @@ pub fn writeDbgInfoHeader(self: *Dwarf, module: *Module, low_pc: u64, high_pc: u...@@ -1823,7 +1823,7 @@ pub fn writeDbgInfoHeader(self: *Dwarf, module: *Module, low_pc: u64, high_pc: u
1823 // We have to come back and write it later after we know the size.1823 // We have to come back and write it later after we know the size.
1824 const after_init_len = di_buf.items.len + init_len_size;1824 const after_init_len = di_buf.items.len + init_len_size;
1825 const dbg_info_end = self.getDebugInfoEnd().?;1825 const dbg_info_end = self.getDebugInfoEnd().?;
1826 const init_len = dbg_info_end - after_init_len;1826 const init_len = dbg_info_end - after_init_len + 1;
18271827
1828 if (self.format == .dwarf64) di_buf.appendNTimesAssumeCapacity(0xff, 4);1828 if (self.format == .dwarf64) di_buf.appendNTimesAssumeCapacity(0xff, 4);
1829 self.writeOffsetAssumeCapacity(&di_buf, init_len);1829 self.writeOffsetAssumeCapacity(&di_buf, init_len);
...@@ -2417,7 +2417,7 @@ fn getDebugInfoOff(self: Dwarf) ?u32 {...@@ -2417,7 +2417,7 @@ fn getDebugInfoOff(self: Dwarf) ?u32 {
2417fn getDebugInfoEnd(self: Dwarf) ?u32 {2417fn getDebugInfoEnd(self: Dwarf) ?u32 {
2418 const last_index = self.di_atom_last_index orelse return null;2418 const last_index = self.di_atom_last_index orelse return null;
2419 const last = self.getAtom(.di_atom, last_index);2419 const last = self.getAtom(.di_atom, last_index);
2420 return last.off + last.len + 1;2420 return last.off + last.len;
2421}2421}
24222422
2423fn getDebugLineProgramOff(self: Dwarf) ?u32 {2423fn getDebugLineProgramOff(self: Dwarf) ?u32 {