Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼

Dan Wahlin

Dr. Dobb's Bloggers

Visual Studio 2010's New 'IntelliTrace' Feature

April 13, 2010

I'm at DevConnections this week in Las Vegas speaking at the Visual Studio 2010 launch event and had a chance to catch up with one of my favorite people -- Ward Bell. Ward is the Vice President of IdeaBlade and was one of the presenters during Scott Guthrie's keynote address. He covered an interesting new feature called "IntelliTrace" that provides a way to capture information during a debug session. Ward and I sat down for a quick chat to talk more about what IntelliTrace offers .NET developers.

Tell me about IntelliTrace.

IntelliTrace is a terrific new historical debugging tool built into Visual Studio 2010. You can think of it as a type of time machine where you can record your application's events as its run and then move backwards and forwards in time through the debugger.

When would you use it?

Have you ever had to deal with one of those chutes and ladders code bases where one thing leads to the next thing which leads to the next thing and you don't know what's really happening? This can be especially hard to deal with when you have an application with a lot of loosely coupled components all being created with dependency injection. You can't do static analysis because nothing refers to anything else since its all dynamic. What do you do today? You place a bunch of break points, you step through, and you go past some point and go "uh", I want to go backwards -- where did I come from?

So then you start over from the beginning and try to remember to stop at the appropriate spot. IntelliTrace allows you to replay exactly what happened as the application ran. I can step forward and backward, it shows me a full stack trace at all times, and I can even see parameters and return values that were passed around.

How do I set it up in Visual Studio?

Go to Tools --> Options --> IntelliTrace. It's enabled by default but will only capture events since they're not expensive to capture. However, the real value begins when you start tracking all of the call information. Every time you debug, IntelliTrace will pop-up and you can use the historical debugger while you're debugging live. Meaning, suppose I'm in there and have a break but want to back up and re-approach the break point, I can do that with IntelliTrace.

I understand you can replay captured sessions?

Yes, somebody else who has captured a debugging session with IntelliTrace can send you the log and the .dlls and pdbs if you don't have them and you can replay their session. The session may have gone to the database (which you don't have), it could be configured in a way you can't reproduce, it could be on a network you can't reach, but you don't care because with a log and the .dlls and pdbs you can replay it.

Having the source code is even better of course because then you can see it as if you were debugging it on your own machine. It's great for those mystery failures where it works on your machine but not someone else's. It's also great in multi-threaded situations where the bug disappears when you step through the application but shows up at regular speed.

Any caveats and how do you work around them?

The most obvious one is that you can't do a debug record on 64-bit machines. You can play back log sessions fine, but you can't F5 to start debugging and recording. But, there's a trick!

If you can change your configuration to run as 32-bit, you can F5 and record. Check out these screenshots that shows what needs to be changed:

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.