This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on Dwarf2 unwind info and optimized code
- From: Christophe LYON <christophe dot lyon at st dot com>
- To: Jim Wilson <wilson at specifix dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 25 Oct 2005 10:08:59 +0200
- Subject: Re: Question on Dwarf2 unwind info and optimized code
- References: <435D0B8B.3020403@st.com> <435D75B5.7080207@specifix.com>
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.