RE: reverse for GDB/MI

Marc Khouzam
2008-12-22T20:27:15Z

Hi,

It was pointed out to me that people who have been doing reversible
debug for a while seems to
have specific commands for reverse debugging and they do have a command
for "go to time point P".
For example http://www.undo-software.com/undodb_man.html:

bgoton <number>
Move forwards or backwards to the specified time, in simulated
nanoseconds.
bgoton +<number> | -<number>
Step forward/backward the specified number of simulated nanoseconds.

Marc

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org
> [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Michael Snyder
> Sent: Friday, December 19, 2008 2:06 PM
> To: Tomas Holmberg
> Cc: Vladimir Prus; gdb-patches@sources.redhat.com
> Subject: Re: reverse for GDB/MI
>
> Tomas Holmberg wrote:
> > Vladimir Prus wrote:
> >> Tomas Holmberg wrote:
> >>
> >>>> I am not quite sure about adding new set of commands for
> that. Can we use
> >>>> --reverse option, thereby not introducing new commands?
> >>> Adding a reverse option to the existing commands is
> possible. But I do
> >>> not think it is a good idea. It is not always obvious what should
> >>> happen when running a standard command in reverse.
> >> Why? -exec-step always steps forward. -exec-step --reverse
> always steps
> >> backward. Seems like a fairly simple model to me.
> >
> > There are other reverse commands than the
> -exec-reverse-step that are more
> > complicated. If you consider all reverse commands to be
> simple variants
> > of the forward commands, then you are correct that there should just
> > be a --reverse option. But I consider them to not be simple
> variants.
>
> They're not simple variants. Some of them have to deal with
> issues like prologues vs. epilogues, stepping thru a return
> back to the callee, etc.
>
> It's mostly handled in infrun and infcmd, by checking the
> "exec-direction" flag.
>
> > You can also look at the documentation to see if the
> reverse commands are
> > just variants of the forward variants. I do not think we
> can replace the
> > documentation for reverse-step, reverse-step-instruction,
> reverse-continue,
> > reverse-finish, reverse-next, and reverse-next-instruction
> and just say it
> > is the reverse variant for the corresponding forward
> commands. Please look
> > at the other reverse commands and see if you can say
> "reverse-finish" is
> > just the reverse variant of finish.
>
> Yeah -- it's not. ;-)
> It's an analogue, that's all.
>