From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 983 invoked by alias); 19 Oct 2006 19:47:10 -0000 Received: (qmail 973 invoked by uid 22791); 19 Oct 2006 19:47:10 -0000 X-Spam-Check-By: sourceware.org Received: from ppsw-7.csi.cam.ac.uk (HELO ppsw-7.csi.cam.ac.uk) (131.111.8.137) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 19 Oct 2006 19:47:07 +0000 Received: from smaug.linux.pwf.cam.ac.uk ([193.60.95.72]:52141) by ppsw-7.csi.cam.ac.uk (ppsw.cam.ac.uk [131.111.8.137]:25) with esmtp id 1Gadqx-000122-PT (Exim 4.63) for gdb-patches@sources.redhat.com (return-path ); Thu, 19 Oct 2006 20:46:56 +0100 Received: from bjh21 (helo=localhost) by smaug.linux.pwf.cam.ac.uk with local-esmtp (Exim 4.22) id 1Gadqx-0004E3-Dt for gdb-patches@sources.redhat.com; Thu, 19 Oct 2006 20:46:55 +0100 Date: Thu, 19 Oct 2006 19:47:00 -0000 From: Ben Harris To: gdb-patches@sources.redhat.com Subject: Fixing stack backtraces on 26-bit ARM Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00244.txt.bz2 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 * 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 Portmaster, NetBSD/acorn26