From: Jonathan Larmour <jifl@eCosCentric.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Fwd: Re: [patch] Add support for ARMv7M devices.
Date: Thu, 15 Mar 2012 06:27:00 -0000 [thread overview]
Message-ID: <4F618BA0.6000603@eCosCentric.com> (raw)
In-Reply-To: <4F60C1F3.30504@redhat.com>
On 14/03/12 16:06, Pedro Alves wrote:
> On 03/11/2012 03:36 AM, Jonathan Larmour wrote:
>>
>> Can you just clarify to me how, for example, a program using VFP registers
>> (such as for Cortex-M4) would use the correct 'g' packet size? The
>> registers correspond to the tdesc, and not to either of the guessed sizes.
>> I guess if I could understand that example, I'll be happy. You can do this
>> off list if you like, to save others from boredom.
>
> Even without a description, and before connecting to the remote side,
> GDB already has a clue of the target's architecture, inferred from the
> executable. GDB updates target_gdbarch based on that, and sets an initial
> expected size of the g packet based on the register set it things the
> target has (based on what it figured out from the executable).
>
> static void *
> init_remote_state (struct gdbarch *gdbarch)
> {
> ...
> /* Record the maximum possible size of the g packet - it may turn out
> to be smaller. */
> rsa->sizeof_g_packet = map_regcache_remote_table (gdbarch, rsa->regs);
>
> If it turns out to be smaller, GDB will re-adjust (process_g_packet).
Ah ok, that's what I was missing. And that uses gdbarch_num_regs() which
corresponds to arm-tdep.h's ARM_NUM_REGS which includes all possible
registers, both VFP and FPA. And later the 'g' packet is shrunk.
So, just to be clear, if neither the user nor target supplies a tdesc, the
block in arm_gdbarch_init() starting with:
if (tdesc_has_registers (tdesc))
will never be run? If that's the case, no need to answer. Or is
arm_gdbarch_init() called a second time after the remote 'g' packet
guessing occurs (which has selected a tdesc)?
> Or did you mean, in the case where the target does send over a
> target description?
No I was thinking more of when GDB only has the executable to go on. But
thanks for that information - it fills other gaps in my knowledge.
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.
** Visit us at the ESC Expo at Design West in San Jose **
** 27-29 March, McEnery Convention Center - Stand #846 **
------["Si fractum non sit, noli id reficere"]------ Opinions==mine
next prev parent reply other threads:[~2012-03-15 6:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 4:25 Jonathan Larmour
2012-03-09 11:44 ` Pedro Alves
2012-03-09 15:53 ` Jonathan Larmour
2012-03-09 16:06 ` Pedro Alves
2012-04-16 7:56 ` Terry Guo
2012-04-16 14:40 ` Jonathan Larmour
2012-04-17 4:06 ` Terry Guo
2012-03-09 15:39 ` Yao Qi
2012-03-09 16:13 ` Jonathan Larmour
2012-03-09 16:29 ` Pedro Alves
2012-03-11 3:37 ` Jonathan Larmour
2012-03-14 16:06 ` Pedro Alves
2012-03-15 6:27 ` Jonathan Larmour [this message]
2012-03-15 17:09 ` Pedro Alves
2012-03-15 18:33 ` Jonathan Larmour
2012-03-15 18:43 ` Pedro Alves
2012-03-15 18:56 ` Jonathan Larmour
2012-03-15 18:58 ` Pedro Alves
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=4F618BA0.6000603@eCosCentric.com \
--to=jifl@ecoscentric.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.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