This is the mail archive of the insight@sourceware.cygnus.com mailing list for the Insight project.


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

Re: Debugging without a frame pointer.



GDB does support debugging functions lacking frame pointers on some
architectures.

If there isn't any more reliable source of information, GDB handles
these cases by actually analyzing the first few instructions of the
function, looking for an instruction that adjusts the stack pointer.
Usually, if you can discover where the stack pointer was on entry to
the function, you can find the saved return address; there's no harm
in choosing a convention here and making GCC stick to it.

For an example of a port that works this way, you might want to check
out mn10200_analyze_prologue in mn10200-tdep.c.

Handling functions whose frame size varies (because they call alloca,
use GCC's variable-sized arrays, etc.) is a challenge.  GDB pretty
much requires that such functions use a frame pointer register.  But
I don't see how GCC could find the local variables reliably unless
there was a frame pointer there for GDB to find.

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