This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add support for ARMv7M devices.
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: gdb-patches at sourceware dot org
- Cc: Richard Earnshaw <Richard dot Earnshaw at buzzard dot freeserve dot co dot uk>, Kazu Hirata <kazu at codesourcery dot com>
- Date: Sat, 30 Oct 2010 00:46:53 +0100
- Subject: Re: [patch] Add support for ARMv7M devices.
- References: <20100609140312.291855664EF@henry1.codesourcery.com> <4C101E0B.4040006@buzzard.freeserve.co.uk> <20100624164149.GD8410@caradoc.them.org> <4C23BA28.80106@buzzard.freeserve.co.uk> <20100816180525.GA13106@caradoc.them.org>
On 16/08/10 19:05, Daniel Jacobowitz wrote:
> On Thu, Jun 24, 2010 at 09:03:52PM +0100, Richard Earnshaw wrote:
>> I'd suggest
>>
>> org.gnu.gdb.arm.m-profile
>
> Here's a version addressing comments from Richard, Matthew, and Doug,
> and also incorporating Jonathan Larmour's changes.
>
> I've moved the is_m check lower in arm_pc_is_thumb, to make "set arm
> force-mode" continue to do something sensible; you could arguably push
> it further down, but this is at least an improvement.
>
> Tested on ARM EABI and by hand; any comments?
Sorry that it's taken me until now to try out this patch. I also see it's
checked in to CVS which is fair enough.
> Jonathan, how's this
> work for you? If your target does not give GDB any registers, then
> this ought to just switch an M-profile binary over to the xpsr. If
> your debug stub previously sends a bogus "cpsr", then it's hard to say
> what will happen.
I'm not quite sure what you mean by this since the xpsr and cpsr are given
the same register number so I thought that what happens at the remote
protocol level would be the same?
> I wouldn't be surprised at an error - any target
> which does that, probably also supplies the FPA registers.
Indeed it does. And that makes GDB unhappy, claiming the response to the
$g packet is too long.
> If it's
> really necessary, we can try to auto-detect that case in the remote
> protocol, but really this is what the XML register descriptions are
> for.
It does create a problem for me at least because we have existing GDB
stubs implementations programmed into flash on Cortex-M targets (it's hard
to do anything else but program into flash with these small chips). So CVS
GDB (and presumably GDB 7.3+) will no longer work with these targets. If
we change the register layout to avoid the FPA registers in the future,
then GDB <= 7.2 won't work, although for that scenario there is at least
the possibility of implementing the XML.
But I can't do anything about the existing stubs out there, other than get
users to reflash their targets which isn't great, or just not use GDB
>7.2. The existing GDB debug stubs don't return any XML target
description, so we can't go back and add that obviously. So there is a
backward compatibility issue.
I also wonder about any JTAG debuggers which support Cortex-M (e.g.
Ronetix PEEDI). Do they return XML data? I haven't actually tried it with
Cortex-M, but looking at a GDB protocol trace with the PEEDI on a
different ARM target, no XML info is provided. If that's also true for
Cortex-M (which seems likely) then these JTAG debuggers will also stop
working. That would probably adversely affect a lot more people than just
the developers using the eCos GDB stubs.
So I think an alternative may be needed. Either the auto-detection you
refer to (although I smell layering violation), or perhaps a 'set' command.
Jifl