This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cortex-M CPSR thumb bit fix


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]