Commit
23e5bfa3bb2beefe49b3e32d9a18b0e1624ca737
by xavier.leroyBetter stack backtraces for C calls in bytecode (#8641)
The previous mechanism worked for C calls that raise an exception, but
not for C calls that call back into OCaml code which raises an
exception.
This commit addresses the issue by saving the PC in the interpreter
stack before a C call, so that the backtrace mechanism always sees it.
However, if an external is declared in the .ml file and exposed in the
.mli file as a val, then ocamlc generates a wrapper that adds a spurious
entry in the stack frame. In this PR, this change in behavior results in
the re-declaration of Printexc.get_callstack as an external instead of a
val, so that the spurious stack frame does not appear in call stacks
obtained from Printexc.get_callstack.