zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit b18031335a13d8f356c1764ebae83b5f93be8fa3 (tree)
parent 9b25bee42c9c86d47ff21580a0ee58e8e14d3989
Author: kcbanner <kcbanner@gmail.com>
Date:   Wed, 12 Jul 2023 02:02:21 -0400

dwarf: use cie.return_address_register instead of assuming it's in the IP register

Diffstat:
Mlib/std/debug.zig | 2+-
Mlib/std/dwarf.zig | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 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 @@ -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; }