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: rs6000 / ppc backend in gdb


On Sun, Jul 31, 2005 at 11:02:36PM +0100, Stefan Burström wrote:
> Clearly, this is a limitation in the ppc backend of gdb. I have reached as
> far as I understand that the skip_prologue function is responsible for
> figuring out the stack frame of the function. However, why is this needed?
> How come gdb does all this? Isn't the position of lr and prev_sp well
> defined in the stack frame?

No, absolutely they aren't!  We've learned, over years of debugging
people's real code, that trusting the architecture defined stack layout
is not a good choice.  For instance, on x86 -fomit-frame-pointer is
popular to free up an additional register.

You weren't very specific about what versions you were testing, but on
x86 you've probably got DWARF2 CFI available, which allows reliable
unwinding without prologue analysis.  On PPC we don't support DWARF2
CFI yet; until recently, GCC wrote out buggered CFI in which LR and
another register had the same register number.  That's been fixed, but
to turn on PPC CFI support we'd need to detect and work around it, and
no one's implemented that yet.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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