mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
dwarf: use cie.return_address_register instead of assuming it's in the IP register
This commit is contained in:
parent
9b25bee42c
commit
b18031335a
@ -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 {
|
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 "???";
|
const module_name = debug_info.getModuleNameForAddress(address) orelse "???";
|
||||||
try tty_config.setColor(out_stream, .dim);
|
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);
|
try tty_config.setColor(out_stream, .reset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1758,7 +1758,7 @@ pub const DwarfInfo = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (has_next_ip) {
|
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 {
|
} else {
|
||||||
context.pc = 0;
|
context.pc = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user