Jim Wilson wrote:
Christophe LYON wrote:

I have been look at the Dwarf2 frame info generated by GCC, and how it works. From what I can see, only the register saves are recorded, and not the restores. Why?


The frame info is primarily used for C++ EH stack unwinding. Since you can't throw a C++ exception in an epilogue, epilogue frame info isn't needed for this, and was never implemented for most targets. Which is a shame.

There is a PR for this, PR 18749, for the x86-64 target. The lack of epilogue unwind info shows up if you run the libunwind testsuite. Otherwise, it is really hard to find an example where the missing unwind info is a problem.


That's what I thought, but wanted to be sure I was not missing something.

On occasions, I wonder whether it wouldn't make sense to generate
different infos in debug_frame and eh_frame: IIUC, GCC tries to
'compress' the debug frame info by generating few advance_loc
instructions (eg only 1 for the whole prologue), which makes sense in
the C++ EH stack unwinding context, but my cause problems in a debugger.

Thanks

Christophe.



Reply via email to