Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging backwards

Tags:

debugging

I have two questions :

  1. While doing source level debugging (using any debugger) does any debugger save state of some iteration/for-loop/any code executed and allow the user to go back to that previously executed code/data state at a later point of time during debugging? The need for this is some variable/pointer is corrupted somewhere earlier in time during execution but is accessed after some time / later in the execution of code and thats when it crashes/hangs the code, so i would like to go back and see which function/at what time the variable was corrupted/wrong value computed and written to it ? Is it possible in any debugger (gcc, MSVC6.0 ...)

  2. Does any debugger/IDE have provision that when a memory address/variable is marked for "analysis", it should display which function in which file, and which code changed that memory(write), every time it is changed/written?

-AD

like image 278
goldenmean Avatar asked Oct 21 '08 13:10

goldenmean


1 Answers

It sounds an awful lot like you will want to grab a copy of Visual Studio 2010.

They are implementing almost exactly what you're describing in #1 - there is a screencast about the new "The Historical Debugger" in Visual Studio Team System 2010 on Channel 9.

There's a bit more about it in this entry located here (this one is for the April 2008 CTP of codename 'Rosario')

I've found this definition of the new Historical Debugger from a blog entry by Maor David (here):

"Visual Studio Historical Debugger captures and records what the application does while it is running. When an error occurs, you can quickly find the root cause by investigating the information that was recorded by the Historical Debugger. At any time during debugging, you can go backward and forward in time to determine where an error occurred."

Here's another video walkthrough also!

Edit: I starting evaluating the most (1) recent CTP drop (31/10 - October 08) of Visual Studio 2010 and they seem to have an early version of the historical debugger implemented. It might be worth checking out.

(1) [http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&displaylang=en]

like image 113
RobS Avatar answered Oct 02 '22 01:10

RobS