This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Testing of reverse debug commands


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]