authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-05 13:38:04+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-09-05 16:32:14+02:00
logf955266cf7c086ddcd51013fe31e3c142cfe8821
tree38390712e0f44e9a3f83c9d67ae35561e544f767
parent1a9bbcce9a1e2df1639ceeb85d05692b5448b67d

std.debug.Dwarf.Unwind.VM: handle aarch64 pac-ret opcodes (by ignoring them)

SelfUnwinder already unconditionally strips pointer authentication codes, so for the self-unwinding case, we just need to make sure that these opcodes don't cause unwinding to fail due to error.UnimplementedUserOpcode.

1 files changed, 8 insertions(+), 1 deletions(-)

lib/std/debug/Dwarf/Unwind/VirtualMachine.zig+8-1
......@@ -460,7 +460,14 @@ pub const Instruction = union(enum) {
460460 .def_cfa_expression => .{ .def_cfa_expr = try reader.takeLeb128(usize) },
461461
462462 _ => switch (@backingInt(inst.low.extended)) {
463 0x1C...0x3F => return error.UnimplementedUserOpcode,
463 // For the moment, we just ignore these so that they don't cause unwinding to
464 // fail; `SelfUnwinder` already unconditionally strips pointer authentication
465 // codes. If this code is ever extended to be useful for remote/offline
466 // unwinding, we will have to actually model the RA sign state properly.
467 0x2C => .nop, // DW_CFA_AARCH64_negate_ra_state_with_pc
468 0x2D => .nop, // DW_CFA_AARCH64_negate_ra_state
469
470 0x1C...0x2B, 0x2E...0x3F => return error.UnimplementedUserOpcode,
464471 else => return error.InvalidOpcode,
465472 },
466473 },