From: Michael Snyder <msnyder@specifix.com>
To: gdb@sourceware.org
Subject: Re: [Reverse debugging] A small demo / test program
Date: Tue, 17 Jun 2008 21:35:00 -0000 [thread overview]
Message-ID: <1213738467.3601.1013.camel@localhost.localdomain> (raw)
In-Reply-To: <1213736473.3601.1009.camel@localhost.localdomain>
What is this?
Two things -- (1) A test for the new branch of gdb with the reverse
debug patch, and (2) A modest "proof of concept" for the idea of
making something more useful out of the "gdbreplay" concept.
So, gdbreplay is a companion of gdbserver, which allows you to make a
log of a remote debugging session and then "play it back" later. Its
major limitation is that it will only play back the remote debugging
log in exactly the same sequence as the original debugging session.
I've written a fairly limited prototype program that can take
approximately the same log, and let you play it back more naturally,
as if it were actually a "live" executing target (within some limits
of course).
You can look at the log file (~msnyder/break/break4.trace), and
immediately see that it does not closely resemble the original log of
the remote protocol traffic -- but that it contains a subset of the
same semantic information. This log was generated mostly by hand, but
I'm working on a post-processor, and I ultimately don't see any
obstacle to using the original log generated by gdb as input to a
replayer.
Also, for historical reasons, my replayer was built out of 'rda', but
I see no technical obstacle to building one either from parts of
gdbserver or from scratch.
A more complete implementation of this could probably replay all of
the remote protocol messages from the log (including those for
threads, shared libraries etc.), and not just the registers and memory
messages as this one does.
--------------------------------------------------------------
For the purpose of testing and demonstrating reverse debug,
this demo accepts commands from gdb including:
'g', 'G', 'm', 'M' (register and memory state)
's', 'c', 'bs', 'bc' (step, continue, reverse-step, reverse-continue)
'Z0', 'z0' (software breakpoints)
Using those and the saved log, it does a fairly convincing
job of pretending to execute a program, both forward and
in reverse. The log contains snapshots of the machine stack
at every execution stop event, so it is always possible to
get a backtrace and to look at local variables.
I am thinking about this as a possible way of adding
reverse debugging test cases to the gdb test suite.
Michael
PS: for people who can't log into sourceware.org,
next time I'm thinking about hosting on the gcc
compile farm (http://gcc.gnu.org/wiki/CompileFarm),
but for now you can check everything out from cvs
and build it yourself:
Patched gdb: msnyder-reverse-20080609-branch
Patched rda: msnyder-tracepoint-checkpoint-branch
For the test load (the 'break' program and log), see
this post:
http://sourceware.org/ml/gdb/2005-06/msg00027.html
prev parent reply other threads:[~2008-06-17 21:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-17 21:01 Michael Snyder
2008-06-17 21:35 ` Michael Snyder [this message]
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=1213738467.3601.1013.camel@localhost.localdomain \
--to=msnyder@specifix.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