Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@codesourcery.com>
To: gdb@sourceware.org
Subject: Re: [PROPOSAL] Checking for supported packets - revised
Date: Thu, 11 May 2006 02:36:00 -0000	[thread overview]
Message-ID: <vt2ac9pwgz3.fsf@theseus.home.> (raw)
In-Reply-To: <20060510225451.GA19844@nevyn.them.org> (Daniel Jacobowitz's message of "Wed, 10 May 2006 18:54:51 -0400")


Daniel Jacobowitz <drow@false.org> writes:
> On Wed, May 10, 2006 at 03:15:17PM -0700, Jim Blandy wrote:
>> It seems to me that GDB should assume that if a packet isn't
>> mentioned, it's not supported.  My thinking is:
>> 
>> - As GDB grows new packets over time, if GDB does not assume these new
>>   packets are unsupported if unmentioned, then we'll grow a new series
>>   of round trips with older stubs that do support the qSupported
>>   packet.  If we're going to go to all this trouble, let's get rid of
>>   these round trips once and for all.
>> 
>> - Under the rule I'm suggesting (call it "unmentioned means
>>   unimplemented"?), if a stub supports a new packet but doesn't
>>   mention it, GDB will never send it.  So stub implementors have an
>>   incentive and a reminder to keep their qSupported responses up to
>>   date.
>
> I do not think that it is feasible to require an existing stub, when
> adding qSupported support, to list the exact set of packets it
> supports currently.  Also, it will make the reply much bigger, for
> packets which might not be used in this session.  Do you think
> it's worth it?  I could be persuaded, but I'm currently leaning
> against; I'll explain my reasoning.
>
> As a basis for comparison, gdbserver currently supports six packets
> with long names, and roughly 28 packets with short names.  The reply
> would be about two hundred bytes - not huge, but a bit unwieldy to
> maintain.

Assuming packets are more often added than deleted, it doesn't seem
like a maintenance problem to me: any mistakes will get caught
quickly; you can't test the packet without fixing them.

> I'm thinking of things like qGetTLSAddr here.  When GDB needs it, it
> will try it.  If the program being debugged needs TLS, then the stub
> supports an environment including TLS, and is likely to support
> fetching the TLS addr.  On the other hand, if it doesn't, the user's
> asked us to make a round trip to the stub and we've done so - it's
> just that we came back with an error message.
>
> For things like qOffsets, the story is a bit different.  That's
> something we send unsolicited at connection, and it's not necessarily
> fatal to what we're doing if it's missing.  So there's a clear
> advantage in mentioning it - that's why I implemented qSupported
> support for it as my example.
>
> That's why I implemented an option to choose an intelligent default for
> new packets.  If it's something that will show up in transcripts with
> other stubs, and its loss is survivable, then requiring it to be
> mentioned saves on roundtrips.
>
> I intend to use the "only supported if mentioned" path ruthlessly for
> new packets.  Let's see, queued up in various trees (and in various
> states - don't bank on all these being submitted and useful):
>
>   - A qOffsets replacement with a different reply format, designed for
>     ELF segments rather than sections.  This is a startup packet,
>     so the round trip is important.
>
>   - The next generation of qPart:features.  Also a startup packet.
>
>   - A "make the remote stub shut down" packet, useful in extended mode.
>     There'd have to be a user command for this, so the round trip
>     seems ignorable; if it fails, we'll let the user know.
>
>   - Additional commands for running programs with arguments in extended
>     mode and attaching to remote packets.  Again, only sent in response
>     to user request, so if the stub doesn't support it, we can find out
>     at that point.
>
> The first two should definitely be assumed missing if they are not
> supported.  The last two could be either.  We could set a policy that
> says "we require use of qSupported for any new packets", though, and
> that wouldn't hurt either.  Simply keep a list in the manual of which
> are which, and save on "m+;M+;c+".

Okay --- I hadn't thought of making that distinction.  If we go that
way, then the protocol documentation should also explain how to decide
whether to make GDB treat a new packet as "only supported if
mentioned" or "try if unmentioned".  Having the rule in your head
alone is no good! :)


  reply	other threads:[~2006-05-11  0:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-14  2:15 [remote] Checking for supported packets Daniel Jacobowitz
2006-03-21 14:28 ` Daniel Jacobowitz
2006-03-22 16:39   ` Paul Koning
2006-03-31  6:38   ` [PROPOSAL] " Daniel Jacobowitz
2006-03-31  9:51     ` Eli Zaretskii
2006-03-31 14:09       ` Daniel Jacobowitz
     [not found]         ` <uvetuaep4.fsf@gnu.org>
     [not found]           ` <20060331141958.GA28073@nevyn.them.org>
2006-04-01 10:22             ` Eli Zaretskii
2006-05-10  7:21               ` [PROPOSAL] Checking for supported packets - revised Daniel Jacobowitz
2006-05-10 18:44                 ` Eli Zaretskii
2006-05-10 21:49                   ` Daniel Jacobowitz
2006-05-11  6:02                     ` Eli Zaretskii
2006-05-11  0:19                 ` Jim Blandy
2006-05-11  2:26                   ` Daniel Jacobowitz
2006-05-11  2:36                     ` Jim Blandy [this message]
2006-05-12 13:55                       ` Daniel Jacobowitz
2006-05-12 18:24                         ` PAUL GILLIAM
2006-05-23 22:11                         ` Data for: " Daniel Jacobowitz
2006-05-26 22:12                           ` Take three: [PROPOSAL] Checking for supported packets Daniel Jacobowitz

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=vt2ac9pwgz3.fsf@theseus.home. \
    --to=jimb@codesourcery.com \
    --cc=gdb@sourceware.org \
    /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