This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: [rfc] dwarf2 backtrace from setcontext
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Andreas Jaeger <aj at suse dot de>, Jakub Jelinek <jakub at redhat dot com>,Glibc hackers <libc-hacker at sources dot redhat dot com>, gdb at gcc dot gnu dot org
- Date: Mon, 12 Jan 2004 18:19:19 -0500
- Subject: Re: [rfc] dwarf2 backtrace from setcontext
- References: <20040111024737.A1431@redhat.com> <m3isji92u3.fsf@gromit.moeb> <20040111025223.A2564@redhat.com> <m3eku692mz.fsf@gromit.moeb> <m37jzy92hr.fsf@gromit.moeb> <20040111030005.C13258@redhat.com> <m3wu7y7k7j.fsf@gromit.moeb> <20040111202020.GB24540@redhat.com> <m3hdz2i60i.fsf@gromit.moeb> <20040111213631.GD24540@redhat.com>
On Sun, Jan 11, 2004 at 01:36:31PM -0800, Richard Henderson wrote:
> The problem is that we need to get back to the REG_CFA state that
> the stack pointer is normally in for x86. We had, in the middle of
> the function, set the unwind info for the stack pointer to the
> value stored in the middle of the ucontext. None of DW_CFA_restore,
> DW_CFA_saved_value or DW_CFA_undefined will produce the value we want.
>
> How would you suggest this be described?
See this message from dwarf2@ if you have it archived:
Subject: Describing unsaved stack pointers
Message-ID: <20030815211415.GA6510@nevyn.them.org>
It seems to me that the best solution would be a new rule, either
val_expression(E) or the simpler val_cfa_offset(N). Then the unwind
information can accurately describe the stack pointer.
The val_expression(E) rule would allow you to express exactly what
you're describing above. There was no response either way to the
suggestion and I haven't had time to write up the obvious proposal.
> The only thing I can think that would work with existing code (both
> in GDB and GCC), actually, would be to close out the current FDE and
> open a new one. Pretend we fell through into a new function.
That would probably work for this example - I can't see any reason that
GDB would care. And for setcontext it makes a certain sense, since you
do seem to have "fallen through" into a different backtrace.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer