Re: Simics & reverse execution

Pedro Alves
2009-08-20T14:50:56Z

On Thursday 20 August 2009 07:54:31, Jakob Engblom wrote:
> > > Sounds like a good idea.  Maybe a 'q' query?
> > > "qReverse", maybe?
> >
> > Why not use the standard qSupported mechanism? I think
> > we've been over this before. :-)
>
> You are the experts on this. Tell us what the query is and we will implement it.

It's not complicated: GDB's first packet to a remote stub is "qSupported". The
target replies back a list of supported features. We just need support in
GDB for a new "reverse" feature. See:
http://sourceware.org/gdb/current/onlinedocs/gdb_34.html#qSupported

In gdb/remote.c, you can get a feeling for what you'd need by e.g.,
looking at remote_protocol_features, and at the "multiprocess" feature
handling. Then, remote.c:remote_can_reverse can be tweaked to inform
the rest of GDB that the remote end supports reversing or not,
instead of the current hardcoded "yes".

Then, you could even hook this to MI's "-list-target-features", so
that a frontend can know upfront if it is connected to a target
that supports reverse or not, so that e.g., it can enable or
disable UI features/widgets/whatnot related to reverse
debugging support.

--
Pedro Alves