authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-09 20:42:54+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-09 20:43:32+02:00
log3f5e782357bbd89e604ff8ba214eb41fe56c8ff7
treef0765de5b5a7c82f52738788914baecc5a709074
parent98f0bf9b67abc0fc2f787df95c26c75dc6db3c88
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.debug: fix FP unwinding for LoongArch


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

lib/std/debug.zig+2-2
...@@ -988,7 +988,7 @@ const StackIterator = union(enum) {...@@ -988,7 +988,7 @@ const StackIterator = union(enum) {
988 // On RISC-V the frame pointer points to the top of the saved register988 // On RISC-V the frame pointer points to the top of the saved register
989 // area, on pretty much every other architecture it points to the stack989 // area, on pretty much every other architecture it points to the stack
990 // slot where the previous frame pointer is saved.990 // slot where the previous frame pointer is saved.
991 if (native_arch.isRISCV()) break :off -2 * @sizeOf(usize);991 if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -2 * @sizeOf(usize);
992 // On SPARC the previous frame pointer is stored at 14 slots past %fp+BIAS.992 // On SPARC the previous frame pointer is stored at 14 slots past %fp+BIAS.
993 if (native_arch.isSPARC()) break :off 14 * @sizeOf(usize);993 if (native_arch.isSPARC()) break :off 14 * @sizeOf(usize);
994 break :off 0;994 break :off 0;
...@@ -996,7 +996,7 @@ const StackIterator = union(enum) {...@@ -996,7 +996,7 @@ const StackIterator = union(enum) {
996996
997 /// Offset of the saved return address wrt the frame pointer.997 /// Offset of the saved return address wrt the frame pointer.
998 const ra_offset = off: {998 const ra_offset = off: {
999 if (native_arch.isRISCV()) break :off -1 * @sizeOf(usize);999 if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -1 * @sizeOf(usize);
1000 if (native_arch.isSPARC()) break :off 15 * @sizeOf(usize);1000 if (native_arch.isSPARC()) break :off 15 * @sizeOf(usize);
1001 if (native_arch.isPowerPC64()) break :off 2 * @sizeOf(usize);1001 if (native_arch.isPowerPC64()) break :off 2 * @sizeOf(usize);
1002 // On s390x, r14 is the link register and we need to grab it from its customary slot in the1002 // On s390x, r14 is the link register and we need to grab it from its customary slot in the