Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Stan Shebs <stanshebs@earthlink.net>
To: gdb-patches@sourceware.org
Subject: Re: RFA [PATCH v4] Implement 'catch syscall' for gdbserver (was Re: RFA [PATCH v3] Implement 'catch syscall' for gdbserver)
Date: Fri, 04 Oct 2013 18:55:00 -0000	[thread overview]
Message-ID: <524F0F1E.7050409@earthlink.net> (raw)
In-Reply-To: <524EFD7F.3060903@redhat.com>

On 10/4/13 10:40 AM, Pedro Alves wrote:

> [...]  Unless perhaps we make GDB
> send a unique id along as well... I think the RSP used to always send
> a sequence number with each packet, and that has been removed a long
> time ago.  I wish I know why it was removed.  It would solve these
> issues.  Maybe we should add it back.

I researched this a bit, since I had the same vague memory, but the
situation is odd.  In 1994, Jim Kingdon documented a $cc:<restofpacket>
at the top of remote.c, as an option that stubs accept, and to this
day the example stubs have their bit of code, but I don't see any
evidence that anything was done in GDB before or since.  (The rationale
may simply have been that the stubs needed to be extended first, this
being before the days of qSupported.)

Sequence numbers don't seem like a great idea, though, potentially
introducing brittleness of various sorts.  Although we didn't really
think about it explicitly at the outset, the remote protocol has
generally evolved in the direction of being stateless; for instance,
we don't send a half-dozen vCont packets that must all be applied
together, we send one packet that includes everything.

Philosophically, this makes sense because real targets are quite
unpredictable - two reads in a row can return different results,
a single-step can result in a dozen new threads, etc.

Another well-known stateless protocol is HTTP, needed due to its
own unpredictabilities (as we all experience every day :-) ).  Now
there are situations where statefulness is useful, which they solve
by using cookies.  In the remote protocol, our analogous situation
is where the target needs to be more like an agent, such as with
tracing, and in those cases we do have identifiers that are
coordinated between host and target, though in a somewhat adhoc
way right now.

I think we could develop the id concept into more of a generic mechanism
that is available for target-side commands, actionpoints in general,
and so forth, perhaps with everything using a single numeric (or
textual?) space, so that "231" can be unambiguously a catchpoint,
rather than either a catchpoint or a trace state variable, depending
on context.

Stan
stan@codesourcery.com


  reply	other threads:[~2013-10-04 18:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-21 20:55 RFA [PATCH v3] Implement 'catch syscall' for gdbserver Philippe Waroquiers
2013-09-21 21:03 ` Eli Zaretskii
2013-09-23 11:51 ` Agovic, Sanimir
2013-09-23 19:32   ` Philippe Waroquiers
2013-09-24  7:07     ` Agovic, Sanimir
2013-09-25 16:55       ` Sergio Durigan Junior
2013-09-25 22:55         ` Philippe Waroquiers
2013-09-27 13:25 ` [COMMIT PATCH] remote.c: Remove unnecessary fields from 'struct stop_reply'. (was: Re: RFA [PATCH v3] Implement 'catch syscall' for gdbserver) Pedro Alves
2013-09-27 19:30 ` RFA [PATCH v3] Implement 'catch syscall' for gdbserver Pedro Alves
2013-09-27 20:13   ` Philippe Waroquiers
2013-09-27 20:55 ` Sergio Durigan Junior
2013-09-29 15:04   ` RFA [PATCH v4] Implement 'catch syscall' for gdbserver (was Re: RFA [PATCH v3] Implement 'catch syscall' for gdbserver) Philippe Waroquiers
2013-10-01  5:16     ` Sergio Durigan Junior
2013-10-02 21:02       ` Sergio Durigan Junior
2013-10-02 19:41     ` Always run the PTRACE_O_TRACESYSGOOD tests even if PTRACE_O_TRACEFORK is not supported. (was: Re: RFA [PATCH v4] " Pedro Alves
2013-10-02 22:08       ` Philippe Waroquiers
2013-10-03 10:16         ` Always run the PTRACE_O_TRACESYSGOOD tests even if PTRACE_O_TRACEFORK is not supported Pedro Alves
2013-10-03 18:40     ` RFA [PATCH v4] Implement 'catch syscall' for gdbserver (was Re: RFA [PATCH v3] Implement 'catch syscall' for gdbserver) Pedro Alves
2013-10-03 19:53       ` Tom Tromey
2013-10-04 17:41         ` Pedro Alves
2013-10-03 22:02       ` Philippe Waroquiers
2013-10-04 17:29         ` Pedro Alves
2013-10-05  9:15           ` Pedro Alves
2013-10-09 21:54             ` Philippe Waroquiers
2013-10-09 22:05               ` Sergio Durigan Junior
2013-10-09 22:09                 ` Philippe Waroquiers
2013-10-04  4:22     ` Luis Machado
2013-10-04 17:40       ` Pedro Alves
2013-10-04 18:55         ` Stan Shebs [this message]
2013-10-07 19:07           ` 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=524F0F1E.7050409@earthlink.net \
    --to=stanshebs@earthlink.net \
    --cc=gdb-patches@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