This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Unwinding CFI gcc practice of assumed `same value' regs
On Tue, Dec 12, 2006 at 03:26:34PM +0000, Andrew Haley wrote:
> Ulrich Drepper writes:
> > Andrew Haley wrote:
> > > Null-terminating the call stack is too well-established practice to be
> > > changed now.
> >
> > Which does not mean that the mistake should hold people back.
>
> Sure it does. Not breaking things is an excellent reason, probably
> one of the the best reasons you can have.
Well, libgcc unwinder handles neither %rbp 0 termination (even
if that would be rephrased as outermost frame on x86-64 is determined
by %rbp == 0 if CFA is %rbp + offset (that would handle the
-fomit-frame-pointer routines where CFA is %rsp + offset)), nor
DW_CFA_undefined %rip termination ATM. Things worked until now
simply because the outermost routine (_start resp. thread_start
hunk in clone in glibc) so far didn't have any unwind info.
What would work with stock libgcc unwinder would probably be if
_start or clone's child hunk had %rip point to memory containing 0
or DW_CFA_val_expression returning 0 (well, on SPARC that would
need to be -8, as RETURN_ADDR_OFFSET is added to it).
Jakub