mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
dwarf: fixup rules for setting ip
This commit is contained in:
parent
2bc2b01dbc
commit
4421b14878
@ -1796,6 +1796,7 @@ pub const DwarfInfo = struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var update_tail: ?*RegisterUpdate = null;
|
var update_tail: ?*RegisterUpdate = null;
|
||||||
|
var has_next_ip = true;
|
||||||
for (context.vm.rowColumns(row)) |column| {
|
for (context.vm.rowColumns(row)) |column| {
|
||||||
if (column.register) |register| {
|
if (column.register) |register| {
|
||||||
if (register == cie.return_address_register) {
|
if (register == cie.return_address_register) {
|
||||||
@ -1828,11 +1829,15 @@ pub const DwarfInfo = struct {
|
|||||||
update_tail = tail.prev;
|
update_tail = tail.prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (has_next_ip) {
|
||||||
context.pc = abi.stripInstructionPtrAuthCode(mem.readIntSliceNative(usize, try abi.regBytes(
|
context.pc = abi.stripInstructionPtrAuthCode(mem.readIntSliceNative(usize, try abi.regBytes(
|
||||||
context.thread_context,
|
context.thread_context,
|
||||||
cie.return_address_register,
|
cie.return_address_register,
|
||||||
context.reg_context,
|
context.reg_context,
|
||||||
)));
|
)));
|
||||||
|
} else {
|
||||||
|
context.pc = 0;
|
||||||
|
}
|
||||||
(try abi.regValueNative(usize, context.thread_context, abi.ipRegNum(), context.reg_context)).* = context.pc;
|
(try abi.regValueNative(usize, context.thread_context, abi.ipRegNum(), context.reg_context)).* = context.pc;
|
||||||
std.debug.print(" new context.pc: 0x{x}\n", .{context.pc});
|
std.debug.print(" new context.pc: 0x{x}\n", .{context.pc});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user