Navigating with IntelliTrace

This topic applies to Visual Studio 2010 Ultimate only.

When you use the Visual Studio debugger, the debugger windows show you a snapshot of your application's state at one point in time. When you use IntelliTrace, you can view the state of your application at many points in time. IntelliTrace records the state of your application at predefined points during a debugging session.

When debugging with IntelliTrace, you can navigate to any point where debug information was collected. When you navigate to a new point in IntelliTrace, the source window shows you the source code where the event occurred. At the same time, the debugger Call Stack window and other debugger windows are updated to show the context in which the event occurred.

This topic describes the ways that you use IntelliTrace to navigate through the collected history of your application.

In This Topic

  • The IntelliTrace Events View

  • The Calls View

  • The Navigation Gutter

  • Search the IntelliTrace History

The IntelliTrace Events View

The IntelliTrace Events view is the default view in the IntelliTrace window, which is docked by default with Solution Explorer and Team Explorer.IntelliTrace events are collected any time IntelliTrace enabled. Therefore, you can use this view during any IntelliTrace session.

Debug History Window Diagnostic Events View

In debug mode, the IntelliTrace Events view shows a list of all events collected by IntelliTrace during the debugging session. The collected events are specified in the Options dialog box. For information about how to specify what events to collect, see Collecting IntelliTrace Information.

To navigate to the point in time when a diagnostic event occurred

  • In the IntelliTrace Events view, click the event you that want to navigate to.

    The source window displays the source code for the point where the event occurred, the instruction pointer moves to that point, and debugger windows are updated to show the context in which the event occurred.

The Calls View

The Calls view provides a hierarchical way of viewing navigating calls and the IntelliTrace events associated with those calls.

Debug History Window Inverted Stack View

Unlike IntelliTrace events, which are always collected when IntelliTrace is enabled, call information is collected only if you enable IntelliTrace Events and Call Information in the Options dialog box. For information about how to enable this option, see Collecting IntelliTrace Information.

To display the Calls view

  • In the toolbar at the top of the IntelliTrace window, click the Show Calls View icon.

The Calls view displays a stack of calls that resembles an inverted version of the debugger Call Stack window. In the Call Stack window, the current call is located on the top. In the Calls view, it is located on the bottom.

When debugging with IntelliTrace, current call means the call that was current in the time context you are viewing. It is not necessarily current in real time.

Indented below the current call, the Calls view shows a list of calls that are made from the current call and IntelliTrace events that are associated with the current call.

To navigate to another call from the current call

  • In the list of calls indented under the current call, double-click the call that you want to navigate to.

    The Calls view is updated to show that the call you double-clicked is now the current call. The source window, instruction pointer, and debugger windows are updated to show the state of your application for the new current call.

To navigate to a call site within the current call

  • In the list of calls indented under the current call, click a call that appears under the current call.

    Do not double-click the call. Double-clicking will cause you to navigate into the call, instead of to the call site.

    In the source window, the instruction pointer moves to the call site. The Call Stack window does not change because you are still in the same call.

To navigate to an IntelliTrace event within current call

  • Click an IntelliTrace event that appears under the current call.

    In the source window, the instruction pointer moves to the call site.

The Navigation Gutter

The navigation gutter is another navigational tool that is available only if you have enabled IntelliTrace Events and Call Information in the Options dialog box. The navigation gutter appears alongside the source window, between the standard debugging gutter and the margin. The standard debugging gutter is the vertical strip where the current instruction pointer and breakpoint icons appear.

You can use the navigation gutter in both live debugging and debugging with IntelliTrace. The color of the navigation gutter changes to indicate the mode that you are in. The default color in live debugging is light gray. When debugging with IntelliTrace, the default color is dark gray.

By default, the navigation gutter is displayed. However, it does not appear if methods and parameters are not collected, if IntelliTrace is turned off, or if you have disabled it in the Options dialog box. If the navigation gutter is turned off and you want to turn it back on, see How to: Enable or Disable the Navigation Gutter.

Navigation Gutter

The navigation gutter contains the following navigational icons, as shown in the previous illustration. Note that Return to Call Site and Step In are equal and opposite commands, as are Go to Previous Event and Go to Next Event.

  • Return to Call Site moves the instruction pointer and debugging context backward in time to the point from which the current function or method was called. If you are working in live debugging mode, this command causes you to begin debugging with IntelliTrace.

  • Step In moves the instruction pointer and debugging context forward in time into the currently highlighted function. This command is available only when you are debugging with IntelliTrace. Step In and Return to Call Site move in opposite directions.

  • Go to Previous Call or IntelliTrace Event moves the instruction pointer and debugging context backward in time to the last call or event. If you are working in live debugging, this command causes you to begin debugging with IntelliTrace.

  • Go to Next Call or IntelliTrace Event moves the instruction pointer and debugging context forward in time to the next call or event for which IntelliTrace data exists. This command is available only when you are debugging with IntelliTrace.

  • Go to Live Mode causes you to return to live debugging at the point where you began debugging with IntelliTrace.

  • Set Debugger Context Here appears on each frame of the current call stack. Click it to set the debugging context to the call frame where it appears

These icons, except for Set Debugger Context, can also be accessed from either the IntelliTrace menu, which is nested under the Debug menu, or from the IntelliTrace toolbar, if you choose to display it. Set Debugger Context appears only in the navigation gutter.

Searching the IntelliTrace History

When IntelliTrace Events and Call Information is enabled, IntelliTrace allows you to search for any recorded instance of a call. When you find the instance you are interested in, you can synchronize the IntelliTrace context to that call, then use the IntelliTrace window and the regular debugger windows to observe that state of your application during that call instance.

There are two ways to search for an instance of a call. One way is by clicking a line of source code from which a call is made. The other is by clicking within the body of the method or function being called.

To find an instance of a call

  1. In a source code window,

    • Right-click it on a line of code from which a call is made, then click Search For This Line In IntelliTrace, or

    • Right-click inside the body of a method or function, then click Search For This Method In IntelliTrace.

    The search results appear in a horizontal gutter at the top the source window, as shown in the following illustration. The search results indicate how many instances search found in IntelliTrace.

  2. In the search results gutter, navigate the results by clicking Go To Next Result, Go To Last Result, Go To Previous Result, or Go To First Result.

    When you navigate to a call instance in the search results gutter, the IntelliTrace window Calls view automatically synchronizes to that call instance.

There are some restrictions on searching that you should be aware of:

  • Search For This Method In IntelliTrace does not work unless the project file containing the method is open in Visual Studio.

  • Search For This Line In IntelliTrace does not return accurate results if the line is a method exit.

See Also

Tasks

How to: Enable or Disable the Navigation Gutter

Concepts

Collecting IntelliTrace Information

Debugging Code Faster with IntelliTrace

Debugging Non-Reproducible Errors With IntelliTrace