Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a debugger that lets me step backwards through the code? [duplicate]

Tags:

c++

c

debugging

Possible Duplicate:
Bidirectional (or reverse) debugging

I've looked up the Omniscient Debugger (http://www.lambdacs.com/debugger/ODBDescription.html), but it's specific to Java. Is there any debugger with this same functionality for native apps, i.e., C/C++?

I haven't made myself clear. I'd like to break on bogus data values/code paths, and then "rollback", debug backwards, until I find the error in the code/logic/design.

I know I can debug step-by-step "forwardly", I want to do the same backwards, so the debugger would need to save its context in each step.

like image 321
Spidey Avatar asked Aug 27 '12 20:08

Spidey


People also ask

Can you step back in a debugger?

You can use step-back via the new Step Backward and Step Forward icons in the Debug toolbar. These icons navigate the events in the Events Tab. So, if you've just taken a step in live debugging (F10 or F11), you can use the Step Backward button to quickly navigate to the previous step.

Can you Debug backwards?

Reverse debugging (also called time travel debugging) provides a viable, cost-effective way of locating bugs as developers can now record, rewind and replay their code.

How do I go back a step in Eclipse debugger?

Open Debug Configuration -> Debugger -> Enable Reverse Debugging at startup . Than you can press shift+F5 or shift+F6 for step back like F5 or F6 for step forward.


1 Answers

In addition to the stack traces to examine past instructions already mentioned here on x86 targets newer gdb also supports recorded program execution and stepping backwards which should come pretty close to what you are looking for.

like image 143
Benjamin Bannier Avatar answered Nov 02 '22 23:11

Benjamin Bannier