public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: duane_ellis@franklin.com
Cc: insight@sourceware.cygnus.com
Subject: Re: Debugging without a frame pointer.
Date: Mon, 08 May 2000 08:01:00 -0000	[thread overview]
Message-ID: <npya5lcch9.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <200004272222.SAA09246@mercury.franklin.com>

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.

      reply	other threads:[~2000-05-08  8:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-27 15:22 Duane Ellis
2000-05-08  8:01 ` Jim Blandy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=npya5lcch9.fsf@zwingli.cygnus.com \
    --to=jimb@zwingli.cygnus.com \
    --cc=duane_ellis@franklin.com \
    --cc=insight@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).