Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "alexandru.sardan@freescale.com" <alexandru.sardan@freescale.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>,
	"catalin.udma@freescale.com"	<catalin.udma@freescale.com>
Subject: RE: 'g' packet reply is too long error when target changes number of registers
Date: Wed, 05 Feb 2014 14:07:00 -0000	[thread overview]
Message-ID: <d469adcda04241c3abdcd5316db0ad17@DM2PR03MB368.namprd03.prod.outlook.com> (raw)
In-Reply-To: <52F1351F.8090608@redhat.com>

Hi,

See my comments inline.

Thanks,
Alex

> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Tuesday, February 04, 2014 8:45 PM
> To: Sardan Alexandru Cezar-B41700
> Cc: gdb@sourceware.org; Udma Catalin-Dan-B32721
> Subject: Re: 'g' packet reply is too long error when target changes
> number of registers
> 
> On 02/03/2014 02:11 PM, alexandru.sardan@freescale.com wrote:
> > Hello,
> >
> > I'm trying to debug an ARM Aarch64 target with gdb-cross and I get a
> > 'g' packet reply is too long error in the following scenario:
> >
> > * I debug my ARM target through a probe that has a gdbserver running on
> it
> > (gdbproxy).
> > * First I load a custom target description in gdb that reflects the
> current
> > hardware I am debugging
> > * I connect to the probe with "target remote probe_ip"
> > * Then I configure the probe to connect to the target (using the same
> target
> > description as the one loaded in GDB)
> > * When I ask for the register Info (info reg), I get the 'g' packet
> reply
> > error.
> >
> 
> > Because the probe had no knowledge of the target that will be debugged
> > beforehand, the "target remote" command will force the probe to reply
> with
> > info about a smaller number of registers (according to the default
> description)
> > than gdb expects.
> 
> This sounds odd.  Why not?  Simply configure it before connecting
> with GDB?  It sounds quite wrong to be changing the target behind
> GDB's back when GDB is _already_ debugging it.  Not just the size
> of the g/G packets may change inadvertently, but the layout as well.
> If the target description changes with your re-configuration, it
> sounds to me like GDB should fetch/recompute the whole target
> description.  Today, I think that can only be done with a
> disconnect/reconnect.
>
 
[Alex Sărdan] In our case "target remote" doesn't start the debug session,
it only connects to the probe. To start debugging we issue some monitor
commands in order to configure the probe.
Is there any other way to recompute the description without disconnect?
When using GDB with Eclipse DSF, issuing a disconnect terminates the DSF
session.

> > This causes rsa->sizeof_g_packet to be reduced.
> >
> > After configuration, the probe will send all the register information
> of the
> > target. This causes the 'g'packet reply error because now, more
> registers
> > are being sent.
> 
> >
> > Why is rsa->sizeof_g_packet shrunk when a smaller packet is received.
> 
>   /* If this is smaller than we guessed the 'g' packet would be,
>      update our records.  A 'g' reply that doesn't include a register's
>      value implies either that the register is not available, or that
>      the 'p' packet must be used.  */
>   if (buf_len < 2 * rsa->sizeof_g_packet)
>     {
> 
> If we don't shrink it, then we'd send too much when writing
> registers, for example, I think?
> 

[Alex Sărdan] Shouldn't this check be handled in the server, since I'm loading
up an XML with the (presumably) correct hardware description?

> --
> Pedro Alves
> 
> 


  reply	other threads:[~2014-02-05 14:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03 14:12 alexandru.sardan
2014-02-04 18:44 ` Pedro Alves
2014-02-05 14:07   ` alexandru.sardan [this message]
2014-02-05 14:56     ` Pedro Alves
2014-02-05 15:14       ` alexandru.sardan

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=d469adcda04241c3abdcd5316db0ad17@DM2PR03MB368.namprd03.prod.outlook.com \
    --to=alexandru.sardan@freescale.com \
    --cc=catalin.udma@freescale.com \
    --cc=gdb@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