public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@codesourcery.com>
To: Jonathan Larmour <jifl@eCosCentric.com>
Cc: gdb-patches@sourceware.org,
	Richard Earnshaw <Richard.Earnshaw@buzzard.freeserve.co.uk>,
	Kazu Hirata <kazu@codesourcery.com>
Subject: Re: [patch] Add support for ARMv7M devices.
Date: Mon, 01 Nov 2010 03:40:00 -0000	[thread overview]
Message-ID: <20101101033953.GA15714@caradoc.them.org> (raw)
In-Reply-To: <4CCB5CED.4030109@eCosCentric.com>

On Sat, Oct 30, 2010 at 12:46:53AM +0100, Jonathan Larmour wrote:
> > 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?

The T bit is in a different place.  There's at least one existing stub
which fakes a "CPSR" register when debugging Cortex-M devices with an
XPSR, and moves the T bit to a different place.

Are your stubs returning FPA registers and a fake CPSR, or are they
returning FPA registers and an XPSR?  Both are pretty wonky.

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

Sure it will.  You can override this by providing an appropriate XML
file to GDB via set tdesc filename (barring discussion, above, of the
T bit).  One which matches your stub.

Or, you can implement the auto-detection somehow; GDB has
infrastructure for that in general, but this case is a bit peculiar.
I don't know enough about what your stub returns to say for sure.

> I also wonder about any JTAG debuggers which support Cortex-M (e.g.
> Ronetix PEEDI).

I do not have access to any debugger which supports Cortex-M and the
GDB protocol but not XML, sorry.  Someone who does needs to figure out
what they do.

-- 
Daniel Jacobowitz
CodeSourcery

  reply	other threads:[~2010-11-01  3:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 14:03 Kazu Hirata
2010-06-09 22:29 ` Doug Evans
2010-06-09 23:04 ` Richard Earnshaw
2010-06-24 16:42   ` Daniel Jacobowitz
2010-06-24 20:04     ` Richard Earnshaw
2010-08-16 18:06       ` Daniel Jacobowitz
2010-08-17  9:00         ` Matthew Gretton-Dann
2010-08-24 15:56           ` Daniel Jacobowitz
2010-10-29 23:47         ` Jonathan Larmour
2010-11-01  3:40           ` Daniel Jacobowitz [this message]
2010-11-03  3:21             ` Jonathan Larmour
2010-11-03 13:17               ` Daniel Jacobowitz
2010-11-10  2:21                 ` Jonathan Larmour
2010-06-10  8:56 ` Matthew Gretton-Dann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101101033953.GA15714@caradoc.them.org \
    --to=dan@codesourcery.com \
    --cc=Richard.Earnshaw@buzzard.freeserve.co.uk \
    --cc=gdb-patches@sourceware.org \
    --cc=jifl@eCosCentric.com \
    --cc=kazu@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).