This is the mail archive of the dwarf2@corp.sgi.com mailing list for the dwarf2 project.


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

RE: Restoring SP (was Re: Appendix 5 problem?)


> I have taken the CFA to mean the value of SP at the point of 
> call, so that
> unwinding SP just means restoring it to the CFA value.
> 
> However, this conflicts with the restriction to unsigned offsets for
> targets that save registers in the caller's frame, such as the PPC or
> SPARC.  We've dealt with this in GCC by adding
> DW_CFA_GNU_negative_offset_extended (and DW_CFA_GNU_window_save).

If you look at proposal 000330-1 which was approved you will find

	DW_CFA_expression(reg, DW_plus_uconst(4))

which can be used to give positive or negative offsets as well as more
complicated expressions.

> Another possibility would be to define the CFA for such a 
> target as being
> above the register save area in the caller's frame, but then how do we
> restore SP?
> 
> My concern for restoring SP comes largely from my decision to 
> use dwarf2
> unwind information for the exception handling unwinder, but it would
> certainly also be useful to have the right value for SP in a debugger.
> 
> Another complication wrt SP that is more EH-specific is that 
> when returning
> to a handler (rather than the call site), we want to pop any 
> arguments that
> have been pushed on the stack (on targets that push args, 
> such as ia32).
> To represent that, we have added DW_CFA_GNU_args_size to 
> record how much
> space has been pushed at the current PC.

I think something like this makes sense for architectures that can save
multiple registers in one instruction (e.g. mc68k and PowerPC).
 
> Thoughts?  
> 
> Jason
> 

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