This is the mail archive of the mailing list for the GCC 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: dwarf2 loclist question

On Mon, Apr 05, 2004 at 07:36:03AM +0200, Josef Zlomek wrote:
> > > Is not return address supposed to be at the same offset from 
> > > frame base or in
> > > the same register in the whole function?
> > 
> > No, its not always true. For example, in case of SH, initial return address is
> > in PR and for non-leaf functions, PR is saved on stack. With simple location
> > description, only one of the above can be used. If return address location on
> > stack is used for DW_AT_return_addr then backtrace fails when program counter
> > is at function entry. 
> I see.
> The original location of return address and the new locations need to be marked
> so that variable tracking could generate the location list. I'll investigate
> how this can be done. It will also need some tweak to var-tracking.
> But generally it should be possible to use var-tracking to generate the location
> list for return address.

Please don't add new code to do this.  The data is already there.  If,
for some reason, we want to support debuggers that require
DW_AT_return_addr, then use the information recorded by the
.debug_frame/.eh_frame machinery, which already knows how to unwind the

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]