public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Best approach for supporting snapshots for QEMU's gdbstub?
@ 2021-05-14 16:06 Alex Bennée
  2021-05-15  6:12 ` Pavel Dovgalyuk
  2021-05-17 16:49 ` Luis Machado
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Bennée @ 2021-05-14 16:06 UTC (permalink / raw)
  To: gdb, QEMU Developers, Pavel Dovgalyuk, Luis Machado
  Cc: Daniel P. Berrangé

Hi,

I've been playing around with QEMU's reverse debugging support which
I have working with Pavel's latest patches for supporting virtio with
record/replay. Once you get the right command line it works well enough
although currently each step backwards requires replaying the entire
execution history until you get to the right point.

QEMU can quite easily snapshot the entire VM state so I was looking to
see what the best way to integrate this would be. As far as I can tell
there are two interfaces gdb supports: bookmarks and checkpoints.

As far as I can tell bookmarks where added as part of GDB's reverse
debugging support but attempting to use them from the gdbstub reports:

  (gdb) bookmark
  You can't do that when your target is `remote'

so I guess that would need an extension to the stub protocol to support?

The other option I found was checkpoints which seem to predate support
for reverse debugging. However:

  (gdb) checkpoint
  checkpoint: can't find fork function in inferior.

I couldn't tell what feature needs to be negotiated but I suspect it's
something like fork-events if the checkpoint mechanism is designed for
user space with a fork/freeze approach.

We could of course just add a custom monitor command like the
qemu.sstep= command which could be used manually. However that would be
a QEMU gdbstub specific approach.

The other thing would be to be more intelligent on QEMU's side and save
snapshots each time we hit an event, for example each time we hit a
given breakpoint. However I do worry that might lead to snapshots
growing quite quickly.

Any thoughts/suggestions?

-- 
Alex Bennée

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-18  5:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 16:06 Best approach for supporting snapshots for QEMU's gdbstub? 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
2021-05-18  5:26     ` Pavel Dovgalyuk

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).