Open FireFox317 opened 4 years ago
I think I found an upstream bug regarding frame pointers on MIPS.
Welcome to the MIPS world, where somebody had the brilliant idea to make the frame pointer point to the bottom of the stack frame. The only reason why I never implemented this for MIPS is that it becomes quite hairy and couldn't be arsed to do so.
If you want to know why the stack frames are oversized check out this small introduction to the o32
(one of the three or four) ABI.
Thanks for the information @LemonBoy! So it's not a bug.
EDIT: This issue has been turned into a tracking issue to implement backtracing on MIPS. Some useful information is provided by @LemonBoy in the comment down below.
I think I found an upstream bug regarding frame pointers on MIPS.For-target mips64-freestanding
(64bit) the following function prologue is emitted:To have a working stack trace on MIPS we should be able to also use ahttps://github.com/ziglang/zig/blob/3b4432d9a6ae7f01f66e5ddcc15bf579d2c47460/lib/std/debug.zig#L342-L349fp_offset
of2 * @sizeOf(usize)
. But that breaks the 32 bit MIPS code. See below.For-target mips-freestanding
(32bit) the following function prologue is emitted:As can be seen for 32bit mips, we also need a offset of 16 to get the previous frame pointer. I would guess that an offset of 8 would be fine too, but that is not what is emitted.@LemonBoy Is this an upstream bug, or is this required on mips32 because of alignment or some other reason?