This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Testing of reverse debug commands
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>, Michael Snyder <msnyder at vmware dot com>, Hui Zhu <teawater at gmail dot com>
- Date: Sun, 12 Jul 2009 15:20:19 +0100
- Subject: Re: Testing of reverse debug commands
- References: <4A5930EE.3040201@vmware.com> <20090712080145.GB10756@adacore.com>
On Sunday 12 July 2009 09:01:45, Joel Brobecker wrote:
> > gdb_test "record" "" "Turn on process record"
> > # FIXME: command ought to acknowledge, so we can test if it succeeded.
>
> This is just a shot in the dark since I really don't have much time
> to double-check this, but does gdb_test_multiple allow you to verify
> that no output was generated? For some reason, I thought it did.
You should be able to see the precord target in the target stack
with "maint print target-stack". You could also use it to plug
that FIXME, but, it's a bit ugly since it exposes precord's
implementation details.
Can't the user ask GDB if process record is in effect (at any time)? This
seems like something a user would want to do --- "hmmm, I forget, am
I recording now?". I can think of other interesting things that would be
nice to be able to query GDB, e.g.: "what is the status of the
recording buffers?" --- maybe there should be a "record status" command
or something like that. Is there one already?
Another hack would be to send GDB another "record" and see if this query
shows up:
record_open ()
/* Check if record target is already running. */
if (current_target.to_stratum == record_stratum)
{
if (!nquery
(_("Process record target already running, do you want to delete "
"the old record log?")))
return;
}
That's also hackish, but the good thing is that you end up adding a test
for a code path that isn't tested currently. :-)
--
Pedro Alves