authorgravatar for 35231115+Rocknest@users.noreply.github.comRocknest <35231115+Rocknest@users.noreply.github.com> 2020-02-01 13:15:49+02:00
committergravatar for 35231115+Rocknest@users.noreply.github.comRocknest <35231115+Rocknest@users.noreply.github.com> 2020-02-05 17:19:00+02:00
logf30feab1b90fe7fa9c9d05acb18d404a3baf717f
tree485c73232176fe6c3a099b85046e8a0770cc6041
parenta56183197dcdab0bfb97489c8a8c22443302b62d

Link the issue in doc comment


1 files changed, 7 insertions(+), 0 deletions(-)

lib/std/debug.zig+7
...@@ -378,6 +378,7 @@ pub fn printSourceAtAddress(debug_info: *DebugInfo, out_stream: var, address: us...@@ -378,6 +378,7 @@ pub fn printSourceAtAddress(debug_info: *DebugInfo, out_stream: var, address: us
378 return noasync printSourceAtAddressPosix(debug_info, out_stream, address, tty_config);378 return noasync printSourceAtAddressPosix(debug_info, out_stream, address, tty_config);
379}379}
380380
381/// TODO resources https://github.com/ziglang/zig/issues/4353
381fn printSourceAtAddressWindows(382fn printSourceAtAddressWindows(
382 di: *DebugInfo,383 di: *DebugInfo,
383 out_stream: var,384 out_stream: var,
...@@ -604,6 +605,7 @@ pub const TTY = struct {...@@ -604,6 +605,7 @@ pub const TTY = struct {
604 };605 };
605};606};
606607
608/// TODO resources https://github.com/ziglang/zig/issues/4353
607fn populateModule(di: *DebugInfo, mod: *Module) !void {609fn populateModule(di: *DebugInfo, mod: *Module) !void {
608 if (mod.populated)610 if (mod.populated)
609 return;611 return;
...@@ -755,6 +757,7 @@ pub const OpenSelfDebugInfoError = error{...@@ -755,6 +757,7 @@ pub const OpenSelfDebugInfoError = error{
755 UnsupportedOperatingSystem,757 UnsupportedOperatingSystem,
756};758};
757759
760/// TODO resources https://github.com/ziglang/zig/issues/4353
758/// TODO once https://github.com/ziglang/zig/issues/3157 is fully implemented,761/// TODO once https://github.com/ziglang/zig/issues/3157 is fully implemented,
759/// make this `noasync fn` and remove the individual noasync calls.762/// make this `noasync fn` and remove the individual noasync calls.
760pub fn openSelfDebugInfo(allocator: *mem.Allocator) !DebugInfo {763pub fn openSelfDebugInfo(allocator: *mem.Allocator) !DebugInfo {
...@@ -963,6 +966,7 @@ pub fn openDwarfDebugInfo(di: *DwarfInfo, allocator: *mem.Allocator) !void {...@@ -963,6 +966,7 @@ pub fn openDwarfDebugInfo(di: *DwarfInfo, allocator: *mem.Allocator) !void {
963 try di.scanAllCompileUnits();966 try di.scanAllCompileUnits();
964}967}
965968
969/// TODO resources https://github.com/ziglang/zig/issues/4353
966pub fn openElfDebugInfo(970pub fn openElfDebugInfo(
967 allocator: *mem.Allocator,971 allocator: *mem.Allocator,
968 data: []u8,972 data: []u8,
...@@ -1001,6 +1005,7 @@ pub fn openElfDebugInfo(...@@ -1001,6 +1005,7 @@ pub fn openElfDebugInfo(
1001 return di;1005 return di;
1002}1006}
10031007
1008/// TODO resources https://github.com/ziglang/zig/issues/4353
1004fn openSelfDebugInfoPosix(allocator: *mem.Allocator) !DwarfInfo {1009fn openSelfDebugInfoPosix(allocator: *mem.Allocator) !DwarfInfo {
1005 var exe_file = try fs.openSelfExe();1010 var exe_file = try fs.openSelfExe();
1006 errdefer exe_file.close();1011 errdefer exe_file.close();
...@@ -1020,6 +1025,7 @@ fn openSelfDebugInfoPosix(allocator: *mem.Allocator) !DwarfInfo {...@@ -1020,6 +1025,7 @@ fn openSelfDebugInfoPosix(allocator: *mem.Allocator) !DwarfInfo {
1020 return openElfDebugInfo(allocator, exe_mmap);1025 return openElfDebugInfo(allocator, exe_mmap);
1021}1026}
10221027
1028/// TODO resources https://github.com/ziglang/zig/issues/4353
1023fn openSelfDebugInfoMacOs(allocator: *mem.Allocator) !DebugInfo {1029fn openSelfDebugInfoMacOs(allocator: *mem.Allocator) !DebugInfo {
1024 const hdr = &std.c._mh_execute_header;1030 const hdr = &std.c._mh_execute_header;
1025 assert(hdr.magic == std.macho.MH_MAGIC_64);1031 assert(hdr.magic == std.macho.MH_MAGIC_64);
...@@ -2072,6 +2078,7 @@ fn getAbbrevTableEntry(abbrev_table: *const AbbrevTable, abbrev_code: u64) ?*con...@@ -2072,6 +2078,7 @@ fn getAbbrevTableEntry(abbrev_table: *const AbbrevTable, abbrev_code: u64) ?*con
2072 return null;2078 return null;
2073}2079}
20742080
2081/// TODO resources https://github.com/ziglang/zig/issues/4353
2075fn getLineNumberInfoMacOs(di: *DebugInfo, symbol: MachoSymbol, address: usize) !LineInfo {2082fn getLineNumberInfoMacOs(di: *DebugInfo, symbol: MachoSymbol, address: usize) !LineInfo {
2076 const ofile = symbol.ofile orelse return error.MissingDebugInfo;2083 const ofile = symbol.ofile orelse return error.MissingDebugInfo;
2077 const gop = try di.ofiles.getOrPut(ofile);2084 const gop = try di.ofiles.getOrPut(ofile);