diff options
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index b58bb315db..ec08244383 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -988,6 +988,8 @@ const StackIterator = union(enum) { // On LoongArch and RISC-V, the frame pointer points to the top of the saved register area, // in which the base pointer is the first word. if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -2 * @sizeOf(usize); + // On OpenRISC, the frame pointer is stored below the return address. + if (native_arch == .or1k) break :off -2 * @sizeOf(usize); // On SPARC, the frame pointer points to the save area which holds 16 slots for the local // and incoming registers. The base pointer (i6) is stored in its customary save slot. if (native_arch.isSPARC()) break :off 14 * @sizeOf(usize); @@ -999,7 +1001,9 @@ const StackIterator = union(enum) { const fp_to_ra_offset = off: { // On LoongArch and RISC-V, the frame pointer points to the top of the saved register area, // in which the return address is the second word. - if (native_arch.isRISCV() or native_arch.isLoongArch()) break :off -1 * @sizeOf(usize); + if (native_arch.isLoongArch() or native_arch.isRISCV()) break :off -1 * @sizeOf(usize); + // On OpenRISC, the return address is stored below the stack parameter area. + if (native_arch == .or1k) break :off -1 * @sizeOf(usize); if (native_arch.isPowerPC64()) break :off 2 * @sizeOf(usize); // On s390x, r14 is the link register and we need to grab it from its customary slot in the // register save area (ELF ABI s390x Supplement ยง1.2.2.2). |
