VS 2010: debugging with IntelliTrace

Original author: Habib Heydarian
  • Transfer
imageOne of the most talked about innovations in Visual Studio VS 2010 is IntelliTrace, which allows the developer to record the execution of the application and “scroll back”. Using IntelliTrace, it can do interesting things, for example, a step backward when debugging.


Let's start with “Hello World!” For an introduction. We will create a simple Windows Forms project and try to take advantage of various IntelliTrace features.

image

Add one line to the button event handler:
Debug.WriteLine("Hello IntelliTrace!")

We launch the application in debug mode and click on the button. On the right side of the Visual Studio window, you should see a new IntelliTrace window, as shown below. Click Break All in the window that appears.

image

After clicking on Break All, the IntelliTrace window will display a list of useful “events”, as shown below. IntelliTrace records what happens in your application in chronological order. Therefore, reading the list in the IntelliTrace window, you understand what is happening:
  • The application is running in debug mode
  • The user clicked on the "Hello IntelliTrace!"
  • The application printed some trace information Debug.WriteLine ()
  • Application paused in debugger

image

If you click on an event in the list, then move to the place in the code that caused it.

image

Step backward during debugging

This feature is disabled by default. In order to activate it, you need to go to Tools-> Options-> IntelliTrace and select the “IntelliTrace events and call information” item, as shown below.

image

In the next screenshot, you can see what happens before and after the step back. The button “Step back” is highlighted on the left side, the right side shows what happens after clicking on it.

image

Also popular now: