diff options
| author | kcbanner <kcbanner@gmail.com> | 2023-07-12 02:02:21 -0400 |
|---|---|---|
| committer | kcbanner <kcbanner@gmail.com> | 2023-07-20 22:58:16 -0400 |
| commit | b18031335a13d8f356c1764ebae83b5f93be8fa3 (patch) | |
| tree | 54f43ff190391a6dcef35d5d8c94e564e8332bde /lib/std | |
| parent | 9b25bee42c9c86d47ff21580a0ee58e8e14d3989 (diff) | |
| download | zig-b18031335a13d8f356c1764ebae83b5f93be8fa3.tar.gz zig-b18031335a13d8f356c1764ebae83b5f93be8fa3.zip | |
dwarf: use cie.return_address_register instead of assuming it's in the IP register
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/debug.zig | 2 | ||||
| -rw-r--r-- | lib/std/dwarf.zig | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 421c6f863e..6083939bde 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -868,7 +868,7 @@ fn printUnknownSource(debug_info: *DebugInfo, out_stream: anytype, address: usiz pub fn printUnwindError(debug_info: *DebugInfo, out_stream: anytype, address: usize, err: UnwindError, tty_config: io.tty.Config) !void { const module_name = debug_info.getModuleNameForAddress(address) orelse "???"; try tty_config.setColor(out_stream, .dim); - try out_stream.print("Unwind information for `{s}` was not available ({}), trace may be incomplete\n\n", .{ module_name, err }); + try out_stream.print("Unwind information for `{s}:{}` was not available ({}), trace may be incomplete\n\n", .{ module_name, address, err }); try tty_config.setColor(out_stream, .reset); } diff --git a/lib/std/dwarf.zig b/lib/std/dwarf.zig index 67ea342cbf..3939737413 100644 --- a/lib/std/dwarf.zig +++ b/lib/std/dwarf.zig @@ -1758,7 +1758,7 @@ pub const DwarfInfo = struct { } if (has_next_ip) { - context.pc = mem.readIntSliceNative(usize, try abi.regBytes(context.thread_context, comptime abi.ipRegNum(), context.reg_context)); + context.pc = mem.readIntSliceNative(usize, try abi.regBytes(context.thread_context, cie.return_address_register, context.reg_context)); } else { context.pc = 0; } |
