@@ -837,12 +837,12 @@ fn readCoffDebugInfo(allocator: mem.Allocator, coff_file: File) !ModuleDebugInfo
837
837
// This coff file has embedded DWARF debug info
838
838
_ = sec ;
839
839
// TODO: free the section data slices
840
- const debug_info_data = di .coff .getSectionDataAlloc (".debug_info" , allocator ) catch null ;
841
- const debug_abbrev_data = di .coff .getSectionDataAlloc (".debug_abbrev" , allocator ) catch null ;
842
- const debug_str_data = di .coff .getSectionDataAlloc (".debug_str" , allocator ) catch null ;
840
+ const debug_info = di .coff .getSectionDataAlloc (".debug_info" , allocator ) catch null ;
841
+ const debug_abbrev = di .coff .getSectionDataAlloc (".debug_abbrev" , allocator ) catch null ;
842
+ const debug_str = di .coff .getSectionDataAlloc (".debug_str" , allocator ) catch null ;
843
843
const debug_str_offsets = di .coff .getSectionDataAlloc (".debug_str_offsets" , allocator ) catch null ;
844
- const debug_line_data = di .coff .getSectionDataAlloc (".debug_line" , allocator ) catch null ;
845
- const debug_line_str_data = di .coff .getSectionDataAlloc (".debug_line_str" , allocator ) catch null ;
844
+ const debug_line = di .coff .getSectionDataAlloc (".debug_line" , allocator ) catch null ;
845
+ const debug_line_str = di .coff .getSectionDataAlloc (".debug_line_str" , allocator ) catch null ;
846
846
const debug_ranges = di .coff .getSectionDataAlloc (".debug_ranges" , allocator ) catch null ;
847
847
const debug_loclists = di .coff .getSectionDataAlloc (".debug_loclists" , allocator ) catch null ;
848
848
const debug_rnglists = di .coff .getSectionDataAlloc (".debug_rnglists" , allocator ) catch null ;
@@ -852,12 +852,12 @@ fn readCoffDebugInfo(allocator: mem.Allocator, coff_file: File) !ModuleDebugInfo
852
852
853
853
var dwarf = DW.DwarfInfo {
854
854
.endian = native_endian ,
855
- .debug_info = debug_info_data orelse return error .MissingDebugInfo ,
856
- .debug_abbrev = debug_abbrev_data orelse return error .MissingDebugInfo ,
857
- .debug_str = debug_str_data orelse return error .MissingDebugInfo ,
855
+ .debug_info = debug_info orelse return error .MissingDebugInfo ,
856
+ .debug_abbrev = debug_abbrev orelse return error .MissingDebugInfo ,
857
+ .debug_str = debug_str orelse return error .MissingDebugInfo ,
858
858
.debug_str_offsets = debug_str_offsets ,
859
- .debug_line = debug_line_data orelse return error .MissingDebugInfo ,
860
- .debug_line_str = debug_line_str_data ,
859
+ .debug_line = debug_line orelse return error .MissingDebugInfo ,
860
+ .debug_line_str = debug_line_str ,
861
861
.debug_ranges = debug_ranges ,
862
862
.debug_loclists = debug_loclists ,
863
863
.debug_rnglists = debug_rnglists ,
@@ -1663,6 +1663,7 @@ pub const ModuleDebugInfo = switch (native_os) {
1663
1663
o_file_di ,
1664
1664
DW .AT .name ,
1665
1665
o_file_di .debug_str ,
1666
+ compile_unit .* ,
1666
1667
) catch | err | switch (err ) {
1667
1668
error .MissingDebugInfo , error .InvalidDebugInfo = > "???" ,
1668
1669
},
@@ -1784,7 +1785,7 @@ fn getSymbolFromDwarf(allocator: mem.Allocator, address: u64, di: *DW.DwarfInfo)
1784
1785
if (nosuspend di .findCompileUnit (address )) | compile_unit | {
1785
1786
return SymbolInfo {
1786
1787
.symbol_name = nosuspend di .getSymbolName (address ) orelse "???" ,
1787
- .compile_unit_name = compile_unit .die .getAttrString (di , DW .AT .name , di .debug_str ) catch | err | switch (err ) {
1788
+ .compile_unit_name = compile_unit .die .getAttrString (di , DW .AT .name , di .debug_str , compile_unit .* ) catch | err | switch (err ) {
1788
1789
error .MissingDebugInfo , error .InvalidDebugInfo = > "???" ,
1789
1790
},
1790
1791
.line_info = nosuspend di .getLineNumberInfo (allocator , compile_unit .* , address ) catch | err | switch (err ) {
0 commit comments