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: dwarf-frame.c question


On Thu, May 29, 2003 at 07:12:53PM -0400, Andrew Cagney wrote:
> Discussed this with AlexO (of gcc).  Let us ruin your day.
> 
> This problem can occure even without recursion.  Consider the C snippet:
> 
> foo ()
> {
> 	if (i)
> 	  abort (with, lots, of parameters)
> 	do; normal; stuff;
> }
> 
> it can be turned into:
> 
> 	branch !i, 1:
> 	push with
> 	push lots
> 	push of
> 	push parameters
> 	call abort
> 1:
> 	do
> 	normal
> 	stuff
> 
> The return address can end up pointing at the ``do'' / 1: line and 
> that's CFI info is definitly not correct for unwinding from abort().

This suggests to me two things:
 - that the problem is writing CFI for a trampoline which begins at the
return address.  Normally that can't happen except for "magic" like
signals.  So there will be an FDE which includes or ends at the return
PC.
 - that there should be a DWARF-3 extension to clarify this; is anyone
interested in discussing it with the committee?

> One idea (the origins of which are unknown) is for the compiler to 
> generate CFI info containing no addresses and have GDB look for that 
> dependant on the PC address being obtained using return or resume 
> (sigtramp, sentinel).
> 
> However, first, does anyone know if the DWARF 2 spec has something to 
> say abou this?

I can't see anything relevant.

-- 
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]