Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Stack traces in arm64 code are not displayed in gdb #6490
Original bug ID: 6490
I ran ocamlopt.opt (compiled with -g) under gdb and placed a breakpoint in a random OCaml function. As you can see the stack trace is wrong after the first frame:
(gdb) break camlBtype__save_desc_1660
Breakpoint 5, 0x00000000004b2f34 in camlBtype__save_desc_1660 ()
Steps to reproduce
Compile ocamlopt.opt with debugging enabled. This also applies to any OCaml program.
Place a breakpoint anywhere and run it.
Use gdb `bt' command to display the stack trace.
Stack traces are normal for C code, but consist of a repeated function for OCaml code.
Comment author: @mshinwell
It turns out that the same problem could be seen on 32-bit ARM platforms.
I've committed a fix to the 4.02 branch that I tested on a 32-bit ARM machine. I have also made a fix to the AArch64 backend that I think will solve the problem, but we should test on real hardware. I will ask the OP to check, and re-open this issue if needs be.