Dan Shearer wrote: > Johan Rydberg, a developer at Virtutech, has got some patches against > 6.3 (for discussion only) that he'll be sending along to this list. I > want to bring up bookmarks for discussion, a topic that isn't yet > addressed by his patches. > > First, what is addressed: Johan has implemented the reverse instructions > rstep, rstepi, rnext and rnexti for PowerPC, Sparc and Sparc64 targets. > [...] Here's a patch against CVS that implements the following commands: - rstep, rstepi - rnext, rnexti The obvious commands "rcontinue" and "rfinished" are not yet implemented, and therefor not included in this patch. The command names are of course up for discussion. Other things that is missing from the patch: - Error handling. GDB will not complain if the remote stub does not implement reverse execution. - Documentaton of the commands. - Some corner cases are not handled yet. - Mechanism for working with bookmarks. What I have done is add a new variable, step_direction, that can either be STEP_DIR_FORWARD or STEP_DIR_REVERSE. A new target vector has also been added; to_reverse. The remote protocol has been extended with two new functions: "bs" and "bc" To implement "rnext" I had to add a new target-specific function that tries to figure out the address of the call instruction based on the last executed instruction and the instruction to be executed, IF the current instruction can be identified as a return insn. This patch should not been seen as a straight forward contribution, but as a proof-of-concept implementation. A lot of things could probably be done better, and more in the "GDB-way", so any input is will appreciated. Currently the patch only works for PowerPC and SPARC targets, though I plan to add support for a few more targets in the near future. Obviously it is a bit hard to test without access to a reversible target but we are working on changing that in the next month or so (Dan has more information on that.) Thanks, Johan