Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ben Harris <bjh21@NetBSD.org>
To: gdb-patches@sources.redhat.com
Subject: Fixing stack backtraces on 26-bit ARM
Date: Thu, 19 Oct 2006 19:47:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.61.0610192020220.15551@smaug.linux.pwf.cam.ac.uk> (raw)

At present, stack backtraces don't work on 26-bit ARM systems because R15 
pulled out of stack frames doesn't get its PSR bits stripped out, so PC 
ends up appearing to point somewhere insane.  This is a simple patch (from 
NetBSD CVS) to apply ADDR_BITS_REMOVE to values pulled from stack frames 
to generate PC.  This patch may have been approved once before, in 2001, 
but it was never applied.

2006-10-19  Ben Harris  <bjh21@NetBSD.org>

	* arm-tdep.c (arm_unwind_pc): Use ADDR_BITS_REMOVE.

--- gdb/arm-tdep.c      2 Jul 2006 21:04:40 -0000       1.3
+++ gdb/arm-tdep.c      14 Oct 2006 10:42:53 -0000      1.4
@@ -1056,7 +1056,7 @@ arm_unwind_pc (struct gdbarch *gdbarch, 
 {
   CORE_ADDR pc;
   pc = frame_unwind_register_unsigned (this_frame, ARM_PC_REGNUM);
-  return IS_THUMB_ADDR (pc) ? UNMAKE_THUMB_ADDR (pc) : pc;
+  return ADDR_BITS_REMOVE (pc);
 }
 
 static CORE_ADDR

-- 
Ben Harris                                                   <bjh21@NetBSD.org>
Portmaster, NetBSD/acorn26               <http://www.NetBSD.org/Ports/acorn26/>


             reply	other threads:[~2006-10-19 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19 19:47 Ben Harris [this message]
2006-10-26 15:43 ` Richard Earnshaw

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=Pine.LNX.4.61.0610192020220.15551@smaug.linux.pwf.cam.ac.uk \
    --to=bjh21@netbsd.org \
    --cc=gdb-patches@sources.redhat.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