This is the mail archive of the gdb@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: Some questions about gdb's remote protocol and reverse debugging


> Ok.
> 
> But... isn't there always going to be a difference when going
> backwards, e.g. if an instruction jumps to an address in a register,
> one cannot know about this jump when stepping backwards (and so, for
> example, one cannot first go back to the destination of the jump, do a
> `bs' to step back over the jump, then carry on with `bc')? Perhaps this
> sort of indirect jump never occurs within a function though, so is not a
> problem for things like reverse-step.
> 
> Anyway, many thanks for you help, 'tis much appreciated. I'm still
> tinkering with things, but i think i should be able to make progress
> now.

Note that you are not executing backwards: you are inspecting what happened. You
do not reverse individual instructions, you are looking at a history. In this
case, of course you can go back forth across jumps, interrupts, returns, and any
other change of location.  How to implement it varies, but either you reexecute
deterministically but one step shorter, or you look into some recorded execution
trace and just move one step back in that. 

/jakob


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