From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11838 invoked by alias); 8 Jul 2010 21:37:28 -0000 Received: (qmail 11828 invoked by uid 22791); 8 Jul 2010 21:37:27 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Jul 2010 21:37:22 +0000 Received: (qmail 3894 invoked from network); 8 Jul 2010 21:37:19 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 8 Jul 2010 21:37:19 -0000 Date: Thu, 08 Jul 2010 21:37:00 -0000 From: Daniel Jacobowitz To: Jonathan Larmour Cc: gdb-patches@sourceware.org, Kazu Hirata Subject: Re: Cortex-M CPSR thumb bit fix Message-ID: <20100708213711.GA6577@caradoc.them.org> Mail-Followup-To: Jonathan Larmour , gdb-patches@sourceware.org, Kazu Hirata References: <4C362657.9040001@eCosCentric.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C362657.9040001@eCosCentric.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00165.txt.bz2 On Thu, Jul 08, 2010 at 08:26:15PM +0100, Jonathan Larmour wrote: > I posted a patch in 2008 here: > http://sourceware.org/ml/gdb-patches/2008-10/msg00462.html but > unfortunately it wasn't applied. Without it, GDB cannot debug Cortex-M > processors as the thumb bit is in a different place in the CPSR register. > > I have updated it for GDB 7.1, as per the attached mail and updated > ChangeLog below. Please compare with: http://sourceware.org/ml/gdb-patches/2010-06/msg00229.html Kazu has been busy with another project, but I think he'll be back to that patch pretty soon. What I'd like, ideally, is a combination of his patch with yours; you have the bits to auto-probe from the binary, and he has the ones that let the target specify. Both are useful. I see that since I wrote the first version of this patch, we've started testing CPSR_T in more places :-( Thanks for finding the extras. I would prefer not to call it the "M-profile CPSR"; it's not called CPSR in the architecture documentation. It's the XPSR. > + /* Cortex-M has different CPSR layout. Use object tags to determine > + * if this was generated for the Microcontroller (M) profile. > + * Cortex-A has a CPSR like previous ARM cores. > + * Cortex-R is unknown. > + */ ARM v7-R has a CPSR, just like ARM v7-A and other non-microcontroller profile devices. I didn't look too closely at the code, except to observe that you didn't follow the GNU coding standards, in spacing or formatting; I'd appreciate it if you could fix that. Let me know if you want specific pointers. Jonathan, Kazu, anyone have a preference on producing a combined patch? -- Daniel Jacobowitz CodeSourcery