From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31100 invoked by alias); 26 Oct 2006 15:43:49 -0000 Received: (qmail 31091 invoked by uid 22791); 26 Oct 2006 15:43:49 -0000 X-Spam-Check-By: sourceware.org Received: from cam-admin0.cambridge.arm.com (HELO cam-admin0.cambridge.arm.com) (193.131.176.58) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Oct 2006 15:43:41 +0000 Received: from cam-owa1.Emea.Arm.com (cam-owa1.emea.arm.com [10.1.255.62]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id k9QFhYQb003733; Thu, 26 Oct 2006 16:43:34 +0100 (BST) Received: from [10.1.205.4] ([10.1.255.211]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 26 Oct 2006 16:43:34 +0100 Subject: Re: Fixing stack backtraces on 26-bit ARM From: Richard Earnshaw To: Ben Harris Cc: gdb-patches@sources.redhat.com In-Reply-To: References: Content-Type: text/plain Date: Thu, 26 Oct 2006 15:43:00 -0000 Message-Id: <1161877409.15497.1.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.8.0nb1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00284.txt.bz2 On Thu, 2006-10-19 at 20:46 +0100, Ben Harris wrote: > 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 I think it would be better to just call arm_addr_bits_remove() directly (more efficient within the back-end); but otherwise this is OK. R.