Support frame pointers on S390x architecture#24
Conversation
2503f02 to
85ba808
Compare
This helps gdb/lldb to unwind the stack correctly and print accurate backtraces for OCaml code.
85ba808 to
c5c0ad3
Compare
OCaml stack frame layout on s390x (with frame pointers)Each OCaml function allocates: frame_size = backchain_reserve(16) + locals + spills + outgoing_args slot_offset(Local n) = n + 16 Contrast with C frame layout (-mbackchain, no -mpacked-stack): Frame pointer walker (fp_backtrace.c): The two conventions are incompatible at SP+8. OCaml puts r14 there; C (-mbackchain) puts The code that needs to walk the stack in fp_backtrace.c and runtime/fiber.c need to understand the convention and potentially go through C frames. I've tried a heuristic based on size of the backchain, and assuming that OCaml will probably have smaller frames. Anything with 160 bytes plus is C code using Options:
|
Preliminary work to support frame pointers and perf on s390x