This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Provide unwind info for x86, x86-64 (and s390{,x}) C++ thunks (PR target/43498)


On Thu, Mar 25, 2010 at 01:28:33AM +0100, Jan Hubicka wrote:
> > We don't emit unwind info on these targets for C++ thunks, while we do so e.g.
> > for ppc/ppc64/ia64/sparc*.
> > I've finally thought about just emitting .cfi_startproc/.cfi_endproc when
> > -fdwarf2-cfi-asm, but as the thunks are emitted before .eh_frame with
> > -fno-dwarf2-cfi-asm, it actually isn't any harder to handle it for both
> > ways of emitting unwind info.
> 
> Note that original idea with defining unwinding in x86_64 ABI was that for
> functions with no stack frame there should be no need for dwarf2 unwind info,
> since the unwinders can easilly handle it themselves.  This was meant primarily
> to make unwinding through trampolines possible, but thunks falls into this category
> too.

That might be true, but unfortunately it wasn't what has been implemented
(x86_64_fallback_frame_state could just never return _URC_END_OF_STACK
and instead return the state for the default unwind info).
Unfortunately I think it is too late to change it now, while current glibc
hopefully will work right, with older glibcs / statically linked binaries
etc. there is the issue of outermost frame - for backtraces etc. the
termination used to be for a long time just a lack of unwind info, only
quite recently it has been changed to have .cfi_undefined %rip
and terminate in clone and _start that way.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]