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 08/07/10 22:37, Daniel Jacobowitz wrote:
> 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.

Hmm, that leads to the question: what if one says it's M and the other
says it's something else? Personally I'd always go with what the actual
binary being debugged says. Or at least that should override the XML
definition. Although in that case the only benefit I can think of for the
XML at all is connecting to a target when you don't have a binary to
debug, which is rather a limited benefit.

> 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.

Changing it to a macro function has the benefit of giving obvious errors
on compilation :).

> I would prefer not to call it the "M-profile CPSR"; it's not called
> CPSR in the architecture documentation.  It's the XPSR. [snip]
> ARM v7-R has a CPSR, just like ARM v7-A and other non-microcontroller
> profile devices. [snip]
> I didn't look too closely at the code, except to observe that you
> didn't follow the GNU coding standards [snip]

I've attached an updated patch based on your comments.

> Jonathan, Kazu, anyone have a preference on producing a combined patch?

I haven't mucked around with the XML stuff before, so if you do want a
combined patch, perhaps Kazu could look, particularly as there were also
unresolved comments on his patch, and none of the XML side was posted.
Hopefully with my patch fixed with your comments, then I'm reducing the
effort to combine at least.

Jifl
-- 
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["Si fractum non sit, noli id reficere"]------       Opinions==mine

Attachment: arm.patch
Description: Text document


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