Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: gdb-patches@cygnus.com
Subject: Re: Patch to add breakpoint extension to remote protocol
Date: Thu, 01 Apr 1999 00:00:00 -0000	[thread overview]
Message-ID: <36CA6A6C.87048B36@cygnus.com> (raw)
In-Reply-To: <5mzp6eyomh.fsf.cygnus.patches.gdb@jtc.redbacknetworks.com>

"J.T. Conklin" wrote:

> cagney> Could I encourage you to take the oportunity to investigate
> cagney> this.  An excert of a patch I've been playing with is below
> cagney> (please ignore the stub_supports_P -> stub_supports_P_packet
> cagney> rename):
>
> Are you asking me to integrate this into my patch?  Do you want a
> patch with only the stub_supports_P_packet changes first?

I'm not worried.  If you're able test/debug both P and B changes and submit a
singe patch I'll be more than grateful.

> cagney> Re: sprintf (buf, "B%x,%lx,%lx", type + 2, (long) addr, len);
>
> cagney> Have a look at remote_write_bytes() and
> cagney> remote_address_masked().  It handles addresses of up to 64
> cagney> bits.
>
> Will do.
>
> cagney> Re: general
> cagney> (I'm probably rambling) Should there be a `set remote*'
> cagney> command to control the use of the B and P packets?  Just in
> cagney> case we find that we really do/don't want GDB using either of
> cagney> these protocol extensions?
>
> Although new variables that control whether B and P packets should be
> used wouldn't be difficult to add, I can't see a situation that would
> require them given a robust protocol (which we have) and implement-
> ation (which GDB has, and any stub should provide).

True.  I can however see the situtation where GDB encounters a target that has
a broken implementation which we don't want to use.


> Back to the statefullness issue I mentioned earlier.
>
> Although I'm currently using GDB over fairly reliable serial links;
> there is nothing that guarentees that a reply will be munged and a
> command (like insert breakpoint) be executed twice.  There doesn't
> seem to be a solution to this problem other than to add sequence
> numbers to the protocol.  Unfortunately, the current specification of
> sequence numbers in the protocol is inadequate to protect against
> duplicated packets.

Yes, the current protocol makes the assumption that the only transmition error
that can occure is data overrun (and an ack ("+" or "-") can't overrun a
buffer.  Suprisingly this assumption holds up very well.

Should the semantics for the set/clear breakpoint commands include an
idenpotent clause?  I can't see any problems with doing this.  (It won't help
other commands such as RUN but it does at least tie this one down better).

> This, plus changes like adding thread stuff into the 'q' escape
> instead of making threads `first class objects' in the protocol;
> adding 'X' for binary memory write instead of a true binary packet
> mode; etc. has me thinking that it's time to re-design the remote
> protocol from the ground up.

Just FYI, I believe that part of the rationale behind the X packet was:

    o    only memory transfers impose a significant overhead

    o    it is strongly preferable to have a protocol based on ASCII (snooping,
debugging...)


> Here are some characteristics I think a new protocol/implementation
> should contain, in no particular order.
>
> * Able to sit on top of both datagram and stream based transport layers.
>   The least common denominator being a small datagram.  Protocol should
>   be able negotiate a larger packet size to minimize overhead for bulk
>   transfers.

Yes, this is an important problem.

> Sorry for rambling, but I'd be interested in your thoughts nonetheless.

My memory from the last time this was discussed is that there were two schools
of thought (aren't there always :-):

    o    The existing GDB protocol works.
        Lets just evolve it a little, spac filler here, sand paper there, ...

    o    The existing protocol should be frozen and we should start again from
scratch.
        What we need is a new protocol for a new century, ...

Technically the latter has much merit.  I think most older GDB engineers
reconise each of the problems you identified.
If it was me doing the work, however, I'd actually prefer the former!  Mainly
because I think that there are other areas of GDB that could do with more
immediate attention :-(

    enjoy,

        Andrew




WARNING: multiple messages have this Message-ID
From: Andrew Cagney <ac131313@cygnus.com>
To: gdb-patches@cygnus.com
Subject: Re: Patch to add breakpoint extension to remote protocol
Date: Tue, 16 Feb 1999 23:07:00 -0000	[thread overview]
Message-ID: <36CA6A6C.87048B36@cygnus.com> (raw)
Message-ID: <19990216230700.3BIAyZl-ppkmZThi8rsJOsZZepUOm-Exz4fQ9XdTSZw@z> (raw)
In-Reply-To: <5mzp6eyomh.fsf.cygnus.patches.gdb@jtc.redbacknetworks.com>

"J.T. Conklin" wrote:

> cagney> Could I encourage you to take the oportunity to investigate
> cagney> this.  An excert of a patch I've been playing with is below
> cagney> (please ignore the stub_supports_P -> stub_supports_P_packet
> cagney> rename):
>
> Are you asking me to integrate this into my patch?  Do you want a
> patch with only the stub_supports_P_packet changes first?

I'm not worried.  If you're able test/debug both P and B changes and submit a
singe patch I'll be more than grateful.

> cagney> Re: sprintf (buf, "B%x,%lx,%lx", type + 2, (long) addr, len);
>
> cagney> Have a look at remote_write_bytes() and
> cagney> remote_address_masked().  It handles addresses of up to 64
> cagney> bits.
>
> Will do.
>
> cagney> Re: general
> cagney> (I'm probably rambling) Should there be a `set remote*'
> cagney> command to control the use of the B and P packets?  Just in
> cagney> case we find that we really do/don't want GDB using either of
> cagney> these protocol extensions?
>
> Although new variables that control whether B and P packets should be
> used wouldn't be difficult to add, I can't see a situation that would
> require them given a robust protocol (which we have) and implement-
> ation (which GDB has, and any stub should provide).

True.  I can however see the situtation where GDB encounters a target that has
a broken implementation which we don't want to use.


> Back to the statefullness issue I mentioned earlier.
>
> Although I'm currently using GDB over fairly reliable serial links;
> there is nothing that guarentees that a reply will be munged and a
> command (like insert breakpoint) be executed twice.  There doesn't
> seem to be a solution to this problem other than to add sequence
> numbers to the protocol.  Unfortunately, the current specification of
> sequence numbers in the protocol is inadequate to protect against
> duplicated packets.

Yes, the current protocol makes the assumption that the only transmition error
that can occure is data overrun (and an ack ("+" or "-") can't overrun a
buffer.  Suprisingly this assumption holds up very well.

Should the semantics for the set/clear breakpoint commands include an
idenpotent clause?  I can't see any problems with doing this.  (It won't help
other commands such as RUN but it does at least tie this one down better).

> This, plus changes like adding thread stuff into the 'q' escape
> instead of making threads `first class objects' in the protocol;
> adding 'X' for binary memory write instead of a true binary packet
> mode; etc. has me thinking that it's time to re-design the remote
> protocol from the ground up.

Just FYI, I believe that part of the rationale behind the X packet was:

    o    only memory transfers impose a significant overhead

    o    it is strongly preferable to have a protocol based on ASCII (snooping,
debugging...)


> Here are some characteristics I think a new protocol/implementation
> should contain, in no particular order.
>
> * Able to sit on top of both datagram and stream based transport layers.
>   The least common denominator being a small datagram.  Protocol should
>   be able negotiate a larger packet size to minimize overhead for bulk
>   transfers.

Yes, this is an important problem.

> Sorry for rambling, but I'd be interested in your thoughts nonetheless.

My memory from the last time this was discussed is that there were two schools
of thought (aren't there always :-):

    o    The existing GDB protocol works.
        Lets just evolve it a little, spac filler here, sand paper there, ...

    o    The existing protocol should be frozen and we should start again from
scratch.
        What we need is a new protocol for a new century, ...

Technically the latter has much merit.  I think most older GDB engineers
reconise each of the problems you identified.
If it was me doing the work, however, I'd actually prefer the former!  Mainly
because I think that there are other areas of GDB that could do with more
immediate attention :-(

    enjoy,

        Andrew




  parent reply	other threads:[~1999-04-01  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199812160030.QAA05122.cygnus.patches.gdb@jtc.redbacknetworks.com>
1999-02-15 23:07 ` Andrew Cagney
1999-04-01  0:00   ` J.T. Conklin
1999-02-16 14:26     ` J.T. Conklin
     [not found] ` <5mzp6eyomh.fsf.cygnus.patches.gdb@jtc.redbacknetworks.com>
1999-04-01  0:00   ` Andrew Cagney [this message]
1999-02-16 23:07     ` Andrew Cagney
1998-12-15 16:31 J.T. Conklin

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=36CA6A6C.87048B36@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=gdb-patches@cygnus.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