This is the mail archive of the gcc@gcc.gnu.org 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


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

> For CPUs which don't have return address register, the offset is different at
> function entry and after prologue.

But the offset to frame base is constant. Changes of stack pointer are described
in location list.

Josef


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