Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Randolph Chung <randolph@tausq.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch/rfa/hppa] Use frame pointer for unwinding
Date: Mon, 17 May 2004 15:23:00 -0000	[thread overview]
Message-ID: <40A8D8E5.9000506@gnu.org> (raw)
In-Reply-To: <20040517023428.GP566@tausq.org>

+    /* Check to see if a frame pointer is available, and use it for
+       frame unwinding if it is.
+
+       There are some situations where we need to rely on the frame
+       pointer to do stack unwinding.  For example, if a function calls
+       alloca (), the stack pointer can get adjusted inside the body of
+       the function.  In this case, the ABI requires that the compiler
+       maintain a frame pointer for the function.
+
+       The unwind record has a flag (alloca_frame) that indicates that
+       a function has a variable frame; unfortunately, gcc/binutils 
+       does not set this flag.  Instead, whenever a frame pointer is used
+       and saved on the stack, the Save_SP flag is set.  We use this to
+       decide whether to use the frame pointer for unwinding.  */
+
+    fp = frame_unwind_register_unsigned (next_frame, HPPA_FP_REGNUM);
+
+    if (frame_pc_unwind (next_frame) >= prologue_end
+        && u->Save_SP && fp != 0)
fp will effectively always be non-zero here, so the ``fp != 0'' is a 
just-in-case?  Suggest adding that, and the GCC bug-number, as additions 
to the comments.

+      {
+	cache->base = fp;
+
+	if (hppa_debug)
+	  fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [frame pointer] }",
+			      paddr_nz (cache->base));
+      }
+    else if (frame_pc_unwind (next_frame) >= prologue_end)
otherwize ok

Andrew




  reply	other threads:[~2004-05-17 15:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-16  2:07 Randolph Chung
2004-05-16 10:36 ` Mark Kettenis
2004-05-16 15:36   ` Randolph Chung
2004-05-16 16:22     ` Mark Kettenis
2004-05-16 16:42       ` Randolph Chung
2004-05-16 16:32 ` Andrew Cagney
2004-05-16 17:03   ` Randolph Chung
2004-05-17  0:13     ` Randolph Chung
2004-05-17  2:34       ` Randolph Chung
2004-05-17 15:23         ` Andrew Cagney [this message]
2004-05-17 16:01           ` Randolph Chung
2004-05-17 17:27             ` Andrew Cagney
2004-05-17 15:13     ` Andrew Cagney
2004-05-17 16:13 John David Anglin
2004-05-17 17:14 John David Anglin
2004-05-17 17:28 ` Randolph Chung
2004-05-17 17:54   ` John David Anglin

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=40A8D8E5.9000506@gnu.org \
    --to=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=randolph@tausq.org \
    /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