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]

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).

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.

Thoughts?  

Jason

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