How does reverse debugging work?

前端 未结 8 995
谎友^
谎友^ 2020-12-04 07:21

GDB has a new version out that supports reverse debug (see http://www.gnu.org/software/gdb/news/reversible.html). I got to wondering how that works.

To get reverse

8条回答
  •  孤街浪徒
    2020-12-04 08:22

    Nathan Fellman wrote:

    But does reverse debugging only allow you to roll back next and step commands that you typed, or does it allow you to undo any number of instructions?

    You can undo any number of instructions. You're not restricted to, for instance, only stopping at the points where you stopped when you were going forward. You can set a new breakpoint and run backwards to it.

    For instance, if I set a breakpoint on an instruction and let it run until then, can I then roll back to the previous instruction, even though I skipped over it?

    Yes. So long as you turned on recording mode before you ran to the breakpoint.

提交回复
热议问题