authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-03 00:42:08-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-03 00:42:08-07:00
logeccbb03063b5a491d923e41d7cb82c6e71534327
tree0c184584fd85f1d7d5d60e5c7b4ddb7ecd1404ab
parentbf85d3db3f281971a5a274e25c90e782a8b692a7

downgrade .debug_info to DWARFv4

gdb, notice me senpai

1 files changed, 3 insertions(+), 4 deletions(-)

src-self-hosted/link.zig+3-4
...@@ -1057,17 +1057,16 @@ pub const File = struct {...@@ -1057,17 +1057,16 @@ pub const File = struct {
1057 const init_len_index = di_buf.items.len;1057 const init_len_index = di_buf.items.len;
1058 di_buf.items.len += init_len_size;1058 di_buf.items.len += init_len_size;
1059 const after_init_len = di_buf.items.len;1059 const after_init_len = di_buf.items.len;
1060 mem.writeInt(u16, di_buf.addManyAsArrayAssumeCapacity(2), 5, target_endian); // DWARF version1060 mem.writeInt(u16, di_buf.addManyAsArrayAssumeCapacity(2), 4, target_endian); // DWARF version
1061 di_buf.appendAssumeCapacity(DW.UT_compile);
1062 const abbrev_offset = self.debug_abbrev_table_offset.?;1061 const abbrev_offset = self.debug_abbrev_table_offset.?;
1063 switch (self.ptr_width) {1062 switch (self.ptr_width) {
1064 .p32 => {1063 .p32 => {
1065 di_buf.appendAssumeCapacity(4); // address size
1066 mem.writeInt(u32, di_buf.addManyAsArrayAssumeCapacity(4), @intCast(u32, abbrev_offset), target_endian);1064 mem.writeInt(u32, di_buf.addManyAsArrayAssumeCapacity(4), @intCast(u32, abbrev_offset), target_endian);
1065 di_buf.appendAssumeCapacity(4); // address size
1067 },1066 },
1068 .p64 => {1067 .p64 => {
1069 di_buf.appendAssumeCapacity(8); // address size
1070 mem.writeInt(u64, di_buf.addManyAsArrayAssumeCapacity(8), abbrev_offset, target_endian);1068 mem.writeInt(u64, di_buf.addManyAsArrayAssumeCapacity(8), abbrev_offset, target_endian);
1069 di_buf.appendAssumeCapacity(8); // address size
1071 },1070 },
1072 }1071 }
1073 // Write the form for the compile unit, which must match the abbrev table above.1072 // Write the form for the compile unit, which must match the abbrev table above.