This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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: [rfc] dwarf2 backtrace from setcontext


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


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