authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-03 03:24:21+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-03 03:29:20+02:00
log0f56d7afe298ae8f2b49d6c3b14fd935c971f1bb
tree9d4cf2e0b6e48c19fc16a0f6d94bfb7403442d4d
parent91fa2c61aacd002228c37cb651fa0a350bd7ac59
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.debug: use correct return address offset for s390x

Makes FP-based unwinding work.

1 files changed, 3 insertions(+), 0 deletions(-)

lib/std/debug.zig+3
......@@ -952,6 +952,9 @@ const StackIterator = union(enum) {
952952 /// Offset of the saved return address wrt the frame pointer.
953953 const ra_offset = off: {
954954 if (native_arch == .powerpc64le) break :off 2 * @sizeOf(usize);
955 // On s390x, r14 is the link register and we need to grab it from its customary slot in the
956 // register save area (ELF ABI s390x Supplement §1.2.2.2).
957 if (native_arch == .s390x) break :off 14 * @sizeOf(usize);
955958 break :off @sizeOf(usize);
956959 };
957960