IntelliTrace and unfamiliar code
One of the many great things about the new IntelliTrace feature in Visual Studio Ultimate 2010 is the ability to walk up to a code base you are not familiar with and determine where to set your first break point.
How many times have you walked up to some code you’ve never modified with the thought, “boy, I’d love to just set a break point in that button clicked event handler…”? With IntelliTrace, that scenario is very simple.
Let me show you, by following along the following steps:
Please download this sample app. All screen shots are coming from that application.
Next, ensure you are running IntelliTrace with the default settings enabled. Best way to do that is to go to Tools->Options… and make sure your screen options look similar to mine:
Open up the CardGame solution and hit F5. You’ll see the following window ( minus the comment bubble ).
What we want to do is find out where in the code the “button clicked” event for the “New Game” button is being handled.
Click the “New Game” button
You should now see something like this:
Ensure the IntelliTrace tool window is displayed in Visual Studio by selecting Debug->IntelliTrace->IntelliTrace Events:
After selecting that menu item, you should see the following tool window in Visual Studio:
Notice how source code is raised in the document well, with the button handler highlighted. NICE!
Now imagine you wanted to do a similar thing, except you wanted to see Gesture events associated with the clicking of a check box. No problem, but you will need to enable that event in the Options dialog, as it is not checked by default:
Be sure to explore the “IntelliTrace Events” in the Options dialog, as you will find all kinds of other options that you can use to get quickly into unfamiliar code, such as when the registry or file is being accessed, perhaps when an environment variable is being set, and so on.
As you explore further, keep in mind that you are able to filter the events in the IntelliTrace tool window so that you only see Gesture events ( for example ). You can do that quickly by typing in “Gesture” in the search toolbox of the IntelliTrace window:
Or by pulling the “All Categories” combo box down, deselecting all ( by unchecking the “All Categories” option ), and selecting “Gesture”:
Summary
This ability to quickly get into a code base that you are unfamiliar with by directing you to the location where you can set your first break point based on gestures made with your application can really save a lot of time. This is of course, just the beginning of all the things this new feature set allows you to do.
More later. Stay tuned…
Cameron
Comments
- Anonymous
July 20, 2010
Hey, thanks for the useful article. One note, though... I think in the image cwskinner.members.winisp.net/.../SNAGHTML2bfad57e.png, you meant to have the arrow pointing to the WinForms Checkbox Checked, not Web Forms Checkbox Checked. (Unless that's a very cleverly disguised web app) :) - Anonymous
July 20, 2010
Good point, thanks!