This is the mail archive of the gdb-patches@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: reverse for GDB/MI


> >> I am not quite sure about adding new set of commands for that. Can we use
> >> --reverse option, thereby not introducing new commands?

What would be the gain from NOT adding the commands, as you see it? It certainly
looks like the most straightforward and easy-to-understand solution. 

> >
> > 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.

Overall, it is not that simple, unfortunately, and that is our experience from
doing reverse execution on a large scale for the past four years. 

First of all, the logic in the implementation side is very different for forward
and backward step.  Second, going into that logic is simpler with a separate set
of commands -- much easier both to send out and parse in the code, as the
reverse bits are obviously separated.  Having a --reverse flag will force
command handlers that only deal with the normal case to check for reverse and
either return an error or take some other action. Why complicate it like that?
If you cannot do reverse, having a set of reverse commands that is clearly
defined by looking just at the command makes ignoring them easier.   There is no
shortage of name space in MI, and thus I cannot see that there is any value to
making things more complicated with an extra flag. 

This is also inline with the gdb command line structure, and I think it eases
understanding the system as a whole if all command interfaces use a similar
semantic structure. 

Note that on a conceptual level there are new possibilities in reverse execution
that do not exist in classic unidirectional debugging. For example, "go to time
point P".  Since a classic unidirectional debugger can only stop or go forward,
this concept did not exist in such a form.  This is not part of the current
patch, but certainly can be seen to come up moving forward (or it might be
already part of bookmarking in the reverse gdb). 


Best regards,

/jakob

_______________________________________________________

Jakob Engblom, PhD, Technical Marketing Manager

Virtutech                   Direct: +46 8 690 07 47    
Drottningholmsvägen 14      Mobile: +46 709 242 646   
11243 Stockholm             Web:    www.virtutech.com  
Sweden
________________________________________________________
 




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