RE: reverse for GDB/MI

Marc Khouzam
2008-12-16T14:45:14Z

> From: Jakob Engblom [mailto:jakob@virtutech.com]
> Sent: Tuesday, December 16, 2008 3:44 AM
>
> > One little annoying point is the command
> > -gdb-set exec-direction [forward | reverse]
> > When this command is issued, to be really correct, MI would need an
> > event to notify a frontend that the exec-direction has changed.
> > This is in case the exec-direction is changed in the console or from
> > another window.
>
> This is to retain compatibility with the normal gdb
> command-line commands for
> reversing. According to an earlier discussion in October,
> this command was part
> of the Michael Snyder patches to support rev exec, and it was
> decided then not
> to change the commands.
>
> > Another option, to avoid adding a new event, is if we could
> disable the
> > changing of exec-direction when running in MI, and simulate
> it in the
> > frontend.
> > The frontend could simply keep track of the exec-direction
> chosen by the
> > user
> > and issue reverse commands or forward commands, appropriately.
>
> The simplest solution is to have no "direction" at all, but
> just a set of
> reverse-X and forward-X commands. But that is not inline
> with the main gdb user
> interface as it stands currently as we understand it.

I think it is nice from a user's perspective to have the two
approaches to reverse debugging. So, I actually like
the exec-direction command from a CLI perspective. It was
for MI, that I felt it caused complications.

But now that I think about it, DSF-GDB provides a console
to the user, which can accept CLI commands. Therefore, I can
imagine that if the user has set the exec-direction to reverse
(even through the Eclipse UI), he would expect 'next' and 'step'
to work backwards if typed in the console.

Sigh... So, I think that the best solution for MI is to have
an event to indicate a change of exec-direction. Disabling that
toggle like I originally suggested could still work but would require
the frontend to simulated it by also converting 'next' into
'reverse-next'
when typed in the command line, which is getting ugly...

Marc