public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "Luis Machado" <luis.machado@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	gdb@gnu.org, "Pavel Dovgalyuk" <pavel.dovgalyuk@ispras.ru>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: Best approach for supporting snapshots for QEMU's gdbstub?
Date: Mon, 17 May 2021 20:01:37 +0100	[thread overview]
Message-ID: <CAFEAcA-ZWpZ5nA8aTgdGh5WReQAEaSHozLnmobwAMk4x=FzmuQ@mail.gmail.com> (raw)
In-Reply-To: <87bl99e03j.fsf@linaro.org>

On Mon, 17 May 2021 at 18:37, Alex Bennée <alex.bennee@linaro.org> wrote:
> Luis Machado <luis.machado@linaro.org> writes:
> > Right. We don't support reverse step/next/continue for remote targets.
> > I think this would be the most appropriate way to implement this
> > feature in GDB. But it is not trivial.
>
> You do because ";ReverseStep+;ReverseContinue+" is part of the gdbstub
> negotiation handshake.
>
> Out of interest how is rr implemented? It presents a gdb interface so I
> thought it was some implemented using some remote magic.

AIUI rr just implements the reverse-step/reverse-continue parts
of the gdb remote protocol. It makes them fast by internally to
its implementation saying "ah, you wanted to do a reverse-step,
I can do that by starting from the best available checkpoint and
going forwards" and by automatically creating checkpoints at
points that it thinks will be useful. gdb and the remote protocol
know nothing about these checkpoints -- they are purely created and
managed under the hood by rr as an optimisation so that reverse-step
is decently fast. (Given that it's the rr end that knows best about
what checkpoints  are available, how expensive it is to create a
checkpoint, etc, that seems not unreasonable.)

There are also a handful of rr-specific gdb commands kind of
like the QEMU-specific ones, which the user can use to say
things like "go directly to this point in time T" which the
gdb UI doesn't have a concept of. (Also because rr starts the
gdb for you it gets a chance to feed it a few gdb macro
definitions which I think mostly just make the debugging
experience a bit smoother rather than being critical parts
of the gdb-to-stub communication.)

thanks
-- PMM

  parent reply	other threads:[~2021-05-17 19:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 16:06 Alex Bennée
2021-05-15  6:12 ` Pavel Dovgalyuk
2021-05-17 16:49 ` Luis Machado
2021-05-17 17:27   ` Alex Bennée
2021-05-17 17:54     ` Luis Machado
2021-05-17 19:01     ` Peter Maydell [this message]
2021-05-18  5:26     ` Pavel Dovgalyuk

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='CAFEAcA-ZWpZ5nA8aTgdGh5WReQAEaSHozLnmobwAMk4x=FzmuQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=gdb@gnu.org \
    --cc=luis.machado@linaro.org \
    --cc=pavel.dovgalyuk@ispras.ru \
    --cc=qemu-devel@nongnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).