<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>IntelliTrace Info : 2010</title><link>http://blogs.msdn.com/ianhu/archive/tags/2010/default.aspx</link><description>Tags: 2010</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>IntelliTrace iTrace Files </title><link>http://blogs.msdn.com/ianhu/archive/2009/11/16/intellitrace-itrace-files.aspx</link><pubDate>Mon, 16 Nov 2009 21:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9923169</guid><dc:creator>ianhu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ianhu/comments/9923169.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ianhu/commentrss.aspx?PostID=9923169</wfw:commentRss><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;If you are not familiar with the new IntelliTrace feature in &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx" mce_href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Visual Studio Team System 2010&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; than you might want to first check out either &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/ianhu/archive/2009/05/13/historical-debugging-in-visual-studio-team-system-2010.aspx" mce_href="http://blogs.msdn.com/ianhu/archive/2009/05/13/historical-debugging-in-visual-studio-team-system-2010.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;my&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; or &lt;/FONT&gt;&lt;A href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/06/16/how-does-vs2010-historical-debugging-work.aspx" mce_href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/06/16/how-does-vs2010-historical-debugging-work.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;John Robbins’&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; introductions to this feature as a general overview of IntelliTrace would be helpful before digging into this article.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;What is an iTrace file?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;In my introduction article linked above I talked a little about how IntelliTrace captures the current state of the debugger at multiple points during a program’s execution and, when F5 debugging, allows you to debug back in time to previous debug states in your program. This in and of itself is a very handy feature, but in this day and age it’s often hard to have a bug with an easy and consistent repro that you can debug on a local dev box.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The solution to this lack of a local repro is that not only does IntelliTrace enhance your local debugging experience, but it also saves all the collected debugger data points into a trace log file (.itrace extension) that can then be opened and debugged using Visual Studio later and on a different machine. The analogy for this scenario is that of &lt;/FONT&gt;&lt;A href="http://en.wikipedia.org/wiki/Flight_recorder" mce_href="http://en.wikipedia.org/wiki/Flight_recorder"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;a black box&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; in an airplane in that iTrace files provide a “voice from the grave” from crashed programs that allow for a developer to debug in and around the point of failure after the fact.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;Integration with Microsoft Test and Lab Manager&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;One of the big new testing features being added in Visual Studio Team System 2010 is the &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/jasonz/archive/2009/05/12/announcing-microsoft-test-and-lab-manager.aspx" mce_href="http://blogs.msdn.com/jasonz/archive/2009/05/12/announcing-microsoft-test-and-lab-manager.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;Microsoft Test and Lab Manager&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; (more info on MTLM on their blog site &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/lab_management/" mce_href="http://blogs.msdn.com/lab_management/"&gt;&lt;FONT size=3 face=Calibri&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;). MTLM is a standalone tool that focuses on the tester role by providing a TFS-integrated UI for managing test cases and lab environments without the overhead of a full Visual Studio installation. Since one of the key focuses of IntelliTrace is to try to eliminate the “no repro” disconnect between developers and testers we knew that we needed to get IntelliTrace integrated with MTLM. This integration is accomplished via a combination of TFS and iTrace files. I’ll detail the scenario more in a future blog post, but at a basic level at anytime during a test run a tester using MTLM can choose to file a bug on a specific test step failure and when that bug is filed an iTrace file of all the recent debugging events and exceptions is automatically collected and attached to the bug. Then, when the developer opens up the bug in Visual Studio, they can just click the iTrace file linked in the bug and be debugging into the exact execution path in which the tester was seeing the failure.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;iTrace files collected during debugging&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Whenever you are running a normal F5 debugging session from the Visual Studio IDE with IntelliTrace turned on you are collected an iTrace file in the background. Now in this scenario you can pretty easily be using IntelliTrace features like browsing back in debug history without ever noticing that this file exists, especially since to keep your system from getting clogged with iTrace files we clean these files out when Visual Studio is shut down. So if you ran into something interesting while debugging from the IDE with IntelliTrace you will need to copy the iTrace file out from its saved location to keep it from being cleaned up. Just look under the following file path to see the iTrace files that have been collected during the current VS session: C:\Users\All Users\Microsoft Visual Studio\10.0\TraceDebugging. With both the IDE scenario and the MTLM scenario iTrace files will be truncated at a specific size (currently set to 100MB by default) to keep from filling up your hard drive. This truncation value will discard older events from the log and can be changed from Tools-&amp;gt;Options-&amp;gt;IntelliTrace-&amp;gt;Advanced.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;Collecting iTrace files from the command line&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;If you want to collect iTrace debugging files without having Visual Studio up and running we’ve provided the IntelliTrace.exe command line tool. IntelliTrace.exe will get its own blog entry sometime in the future but if you want to try figuring out how to get it running just try starting with the /? command for help. Intellitrace.exe is located in your Visual Studio install at “Team Tools\TraceDebugger Tools.”&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;Working with iTrace files in Visual Studio&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;(Note: All screenshots are from my current working build and will look a little different from Beta 2 builds)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Regardless of if you collected your iTrace file via MTLM, Visual Studio or IntelliTrace.exe when you first open it up in Visual Studio you will end up with a document that looks somewhat like the below.&lt;/FONT&gt;&lt;/P&gt;&lt;A title="MainITracePage by cwruwrestler, on Flickr" href="http://www.flickr.com/photos/7619226@N05/4109706329/" mce_href="http://www.flickr.com/photos/7619226@N05/4109706329/"&gt;&lt;IMG alt=MainITracePage src="http://farm3.static.flickr.com/2652/4109706329_2b43ff5bfa_b.jpg" width=1024 height=522 mce_src="http://farm3.static.flickr.com/2652/4109706329_2b43ff5bfa_b.jpg"&gt;&lt;/A&gt; 
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Note that at this point we’ve just opened up the document summarizing the debugging session. No debugging session has been started and the time to open up the document should be pretty minimal. At the top of the document you will see a chart showing all the threads that were running during the life of this debugging session. Below that there are a series of lists containing more information about Threads, Exceptions, Test Events, System Information and Modules for the debugging session. Currently, the Exceptions list is expanded out and showing all the exceptions that were encountered during the debugging run. The exception that is currently selected in this list is represented in the thread timeline by a vertical red bar. This bar helps you match up exactly where in your program’s execution an exception was being thrown. In addition to supplying the thread, HResult and message of the exception we will list out the stack of each thrown exception in the textbox below the exceptions list.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Threads List:&lt;/FONT&gt;&lt;/P&gt;&lt;A title="ThreadsList by cwruwrestler, on Flickr" href="http://www.flickr.com/photos/7619226@N05/4110469844/" mce_href="http://www.flickr.com/photos/7619226@N05/4110469844/"&gt;&lt;IMG alt=ThreadsList src="http://farm3.static.flickr.com/2769/4110469844_e3bccd1b8a_o.png" width=498 height=205 mce_src="http://farm3.static.flickr.com/2769/4110469844_e3bccd1b8a_o.png"&gt;&lt;/A&gt; 
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The threads list provides a table view of the threads active during your debugging session. The actively selected thread will be highlighted in the thread chart above, and vice-versa. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;System Info:&lt;/FONT&gt;&lt;/P&gt;&lt;A title="SystemInfo by cwruwrestler, on Flickr" href="http://www.flickr.com/photos/7619226@N05/4110469866/" mce_href="http://www.flickr.com/photos/7619226@N05/4110469866/"&gt;&lt;IMG alt=SystemInfo src="http://farm3.static.flickr.com/2734/4110469866_9e06819646_o.png" width=340 height=346 mce_src="http://farm3.static.flickr.com/2734/4110469866_9e06819646_o.png"&gt;&lt;/A&gt; 
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The system information section contains a set of information about the computer that this iTrace file was collected on. It seems pretty basic, but this info has already come in useful several times for me during my development work. In particular knowing the OS, the number of processers and the CLR version have been useful to me when investigating bugs that QA has provided me with iTrace files for. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Test Data:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;I don’t have a picture of this right now, as I’m going to be speaking more about this when I cover MTLM integration in greater depth. When you collected an iTrace file via MTLM (since this file was not collected via MTLM the section is grayed out) the test data section will contain info on all the test steps that were logged via MTLM during the execution of the tests.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Modules:&lt;/FONT&gt;&lt;/P&gt;&lt;A title="Modules by cwruwrestler, on Flickr" href="http://www.flickr.com/photos/7619226@N05/4109706409/" mce_href="http://www.flickr.com/photos/7619226@N05/4109706409/"&gt;&lt;IMG alt=Modules src="http://farm3.static.flickr.com/2535/4109706409_81fcbf398c_o.png" width=919 height=118 mce_src="http://farm3.static.flickr.com/2535/4109706409_81fcbf398c_o.png"&gt;&lt;/A&gt; 
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;As expected, this control lists out the modules that were loaded during debugging.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;On all of these controls there is a search box above the list. If you are looking for a specific module or exception just start typing into one of those boxes to narrow down the results being shown in the list.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;Starting a debug session from an iTrace file&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Up until now we’ve been dealing with the information that you can glean from the summary page of an iTrace file. But while it can be quite informative the real point of the summary page is to allow the user to jump into debugging close to some point of interest. Lots of information can be collected during a debugging session and if you were to just jump into debugging an iTrace file blindly it could take a while to get to the correct location to start diagnosing a failure.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;From an iTrace summary page you can jump into debugging from a thread, from an exception or from a test event (with a caveat that I’ll mention later for test events). For threads you can double click on a thread in the thread chart, double click on a thread in the threads list or click the “Start Debugging” button. Any of these options will start up the debugger and jump you to the last event that we collected on that thread. We chose the last event as in many cases an iTrace log captured a failure or crash so starting at the end point makes more sense than starting at the beginning of the log when all was running smoothly. For exceptions, you can either double click the exception in the list, or click the “Start Debugging” button below the exception list. Starting debugging on an exception will start the debug session exactly on the exception event selected (see picture below). Note that starting the session is a slightly slow process and it might take a bit for the debugger to get up and running. Test data function much the same as exception with the only difference being that since test events are not represented in our debugging UI debugging context will actually be set to the event in time nearest the selected test event.&lt;/FONT&gt;&lt;/P&gt;&lt;A title="DebuggingOnException by cwruwrestler, on Flickr" href="http://www.flickr.com/photos/7619226@N05/4110469920/" mce_href="http://www.flickr.com/photos/7619226@N05/4110469920/"&gt;&lt;IMG alt=DebuggingOnException src="http://farm3.static.flickr.com/2456/4110469920_3d94de06ae_o.png" width=1273 height=962 mce_src="http://farm3.static.flickr.com/2456/4110469920_3d94de06ae_o.png"&gt;&lt;/A&gt; 
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;This entry is mainly focused on the iTrace file and summary page so I’ll cover more about the IntelliTrace UI during debugging later. But as for now, you can look at the picture above and see that debugging has been started and our context has been set to the exception that I clicked in the summary page by looking at the source location and the autos window.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;Up next&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Coming up next I’ll be talking more about the various controls that you can use to move around in IntelliTrace debugging data and what data we will be showing in the Visual Studio UI.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9923169" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio+team+system/default.aspx">visual studio team system</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio/default.aspx">visual studio</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/team+system/default.aspx">team system</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/beta/default.aspx">beta</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/2010/default.aspx">2010</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/historical+debugger/default.aspx">historical debugger</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/intellitrace/default.aspx">intellitrace</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/itrace/default.aspx">itrace</category></item><item><title>Adios Historical Debugging. Hello IntelliTrace.</title><link>http://blogs.msdn.com/ianhu/archive/2009/10/20/adios-historical-debugging-hello-intellitrace.aspx</link><pubDate>Tue, 20 Oct 2009 16:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9910005</guid><dc:creator>ianhu</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/ianhu/comments/9910005.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ianhu/commentrss.aspx?PostID=9910005</wfw:commentRss><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;It’s been a little while since I’ve gotten a post up here due in part to two main reasons. First off, we’ve been pushing really hard as a dev team in getting Beta 2 polished up and out the door. And secondly, the actual name of our feature has been in flux for a little while and I wanted that to be sorted out before I blogged any more.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;So as of this past Monday Beta 2 of Visual Studio 2010 and .NET Framework 4.0 have been released out to customers (MSDN subscribers can grab the download from &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;). And at the same time we finally got clearance to use IntelliTrace as the official name for our new historical debugging feature. So from here on out expect to see much more of me blogging about the ways that IntelliTrace can help improve your debugging process and also more about how we built V1 of IntelliTrace and what we’re going to be doing for V2.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;For an introduction on what Intellitrace is all about check out &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/ianhu/archive/2009/05/13/historical-debugging-in-visual-studio-team-system-2010.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;my intro&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; on the topic or a &lt;/FONT&gt;&lt;A href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/10/19/vs-2010-beta-2-intellitrace-in-depth-first-look.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;recent blog post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; from John Robbins.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9910005" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio/default.aspx">visual studio</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/team+system/default.aspx">team system</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/2010/default.aspx">2010</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/historical+debugger/default.aspx">historical debugger</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/microsoft/default.aspx">microsoft</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/beta+2/default.aspx">beta 2</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/intellitrace/default.aspx">intellitrace</category></item><item><title>Diagnostic Events in Historical Debugging</title><link>http://blogs.msdn.com/ianhu/archive/2009/06/18/diagnostic-events-in-historical-debugging.aspx</link><pubDate>Thu, 18 Jun 2009 20:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9776784</guid><dc:creator>ianhu</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/ianhu/comments/9776784.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ianhu/commentrss.aspx?PostID=9776784</wfw:commentRss><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Cambria','serif'; COLOR: #365f91; FONT-SIZE: 18pt; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin; mso-themecolor: accent1; mso-themeshade: 191"&gt;Diagnostic Events in Historical Debugging&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;If this post is the first time that you have heard about the historical debugging feature in &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx"&gt;&lt;FONT size=3 face=Calibri&gt;Visual Studio Team System 2010&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;, then you might want to first take a look at my &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/ianhu/archive/2009/05/13/historical-debugging-in-visual-studio-team-system-2010.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;little overview&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; of this nifty new feature before diving into the info below (John Robbins also has an excellent blog post &lt;/FONT&gt;&lt;A href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/06/16/how-does-vs2010-historical-debugging-work.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;). But if you don’t want the read that article the gist of the historical debugger is that it records your debugging context at specific points during your program’s execution. Then, while debugging (or after finishing debugging if you load up one of the log files that we collect) you can move back to the locations where we collected data to examine things like locals, parameters and return values. You can set the historical debugger to collect data at every function enter and exit but, to avoid the slowdown that this cause,s by default we just collected data at diagnostic events. This article is here to give you some more information on diagnostic events and on how they are used in the historical debugger.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;What is a diagnostic event?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Simply put, a diagnostic event is a specific point during a debugging session that is likely to be of interest to the programmer when debugging. Examples of diagnostic events that we define are things like opening a file, writing to the registry or clicking on a WPF button. Diagnostic events were selected with the duel criteria of being placed at interesting locations, but not being at any locations that would be called too often and create excessive slowdown in your application.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;How will I see what diagnostic events are being collected?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Since historical debugging when collecting on just diagnostic events is low overhead it will be on by default with all managed projects in VSTS 2010. So if you just start up a basic C# console application, set a break point and hit run you will see the new Debug History tool window pop up docked with the Solution Explorer. By default this window will show you a list of all the diagnostic events that have been collected during your current debugging session. Below I’ve posted a picture of the Debug History window for a little WinForms application that I created to exercise a few different diagnostic events (file open, button click and registry write). From this picture I’ll provide a brief walkthrough of the Diagnostics Events control (Note: I’m working with the current Beta 2 in progress bits, so please understand both that it will look a little different from Beta 1 and that the final RTM product might also look somewhat different). At the point this picture was taken the program was stopped in the live debugger with a breakpoint at the end of the main function.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;IMG src="http://farm4.static.flickr.com/3333/3636332355_9d706223d2_o.png" mce_src="http://farm4.static.flickr.com/3333/3636332355_9d706223d2_o.png"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The main space in this control is occupied by a flat, chronological list of the most recent diagnostic events hit during your debugging session. If you look at the bottom of the list you will see the “Live Event” event, this entry corresponds to the current location of the live debugger and tells us that we are at a breakpoint at line 26 in the file form1.cs. Moving up from there you can see that we recorded a few registry access events, a few file events and a user input gesture. Each entry in this list represents a specific location where we grabbed much of the current debugger state and stuffed it into our log file. Using this flat list you can jump back in time to any of the diagnostic events that the historical debugger captured. Note that there are page forward and page back buttons at the bottom of the control for if we get to large a number of events collected to browse easily.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;If you are looking for a specific event or event type in the list we’ve provided a few browsing aides in this tool window. First off, if you start typing in the search box the diagnostic events in the list will be filtered down to just those events containing your search text, very helpful when trying to track down a specific exception that was thrown. And secondly, if you use the “All Categories” and “All Threads” dropdowns you can restrict the list into showing just diagnostic events from specific categories (see the below tools-&amp;gt;options section to learn more about our categories) or just showing diagnostic events from specific threads.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;What happens to the debugger when I select a diagnostic event?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;In the picture below I’ve selected the “File: Close” event. Also I’m showing the rest of the IDE along with the tool window so you can see how the debugging context changed with the switch over to historical mode.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;IMG style="WIDTH: 1024px; HEIGHT: 538px" src="http://farm4.static.flickr.com/3333/3638365225_c927acfd7e_b.jpg" width=1024 height=538 mce_src="http://farm4.static.flickr.com/3333/3638365225_c927acfd7e_b.jpg"&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Notice that in the diagnostic events tool window we’ve selected the event that you are currently at, as well giving some inline expanded information about the event. For this file close event we give a little more information about the event “Close a FileStream accessing the path C:\2xj3hs4l.aox,” we mention the thread the event took place on and we give some quick links to other debugger tool windows that might have some more information about the event.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Aside from the tool window being updated there were some other changes in the IDE when we selected an event in the flat list and moved back to historical mode. First off, if you look at the source editor you won’t see the usual yellow arrow indicating the next statement anywhere in the source file. Instead you will see a curved orange arrow located at the end of the “using(FileStream fs =…)” block of code. The curved orange arrow indicates that the current historical debugger context is somewhere in external code below the given statement, roughly corresponding to the green arrow that the live debugger uses when you are stopped in external code. In general when you move between diagnostic events your debugger context will not be located directly in user code, as the diagnostic events are all defined at specific points in Microsoft framework code. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;This can be better illustrated by looking at the callstack window in the picture above. When we moved back to the diagnostic event the callstack updated to the time when we captured that event. The actual code context is down in mscorlib.dll at FileStream.Dispose, but since we don’t have code for that location we show the location in user code that triggered that specific diagnostic event (that being when the end of the using statement disposed of the FileStream). When moving back in history we will also populate the values in the autos and the watch windows with some specific limitations. Those limitations being that we will just capture primitive values (strings, doubles, ints ect…) and two levels of primitive values off of any objects.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;How can I change what diagnostic events are captured?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;We’ve tried to pick a solid set of diagnostic events that provide coverage of some common problem areas and that are not called too often in a program (in which case collection could slow down your application too much). But in specific cases our default settings might not be the right solution for every user, so we’ve added the ability to trim or add to this initial set of diagnostic events via a tools options page.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;If you open up Tool-&amp;gt;Options you will see a new option for Historical Debugger in the list. Clicking this item will first off take you to the general settings page shown below.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;IMG style="WIDTH: 748px; HEIGHT: 430px" src="http://farm3.static.flickr.com/2433/3639175390_0344011783_o.png" width=748 height=430 mce_src="http://farm3.static.flickr.com/2433/3639175390_0344011783_o.png"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;On this page you will notice that by default (for managed projects) historical debugging is turned on and is set to collect debugging data just at diagnostic events. In a later blog post I’ll cover more about the “Event, Methods and Parameters” setting but in a nutshell turning on that setting makes you collect data at diagnostic events &lt;B style="mso-bidi-font-weight: normal"&gt;and&lt;/B&gt; at all function enters and exits. This gives you much more complete historical debugging data to look at, but comes at a much higher cost in terms of application performance while debugging.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;For now, just we’ll just leave the general settings as they are and move on to the “Diagnostic Events” tab shown below.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;IMG style="WIDTH: 748px; HEIGHT: 429px" src="http://farm4.static.flickr.com/3537/3638365279_53089fd02f_o.png" width=748 height=429 mce_src="http://farm4.static.flickr.com/3537/3638365279_53089fd02f_o.png"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;On this page you can see the selection of diagnostic events that we provide broken down by various framework categories. By checking or unchecking events you will either add them to or remove them from the set of events that we capture while debugging. A example could be if your application is doing tons of file opens and file closes you could turn off the collection of file diagnostic events to keep collection from slowing down too much.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;Diagnostic Events Summary&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;With the above post I’ve tried to lay out a little bit of how diagnostic events work, how you can use them to browse back into debugging history and how to configure what diagnostic events are collected. By collecting data at common fault areas / points of debugging interest we’ve think that they will be useful in solving many debugging issues and the low overhead allows us to turn them on by default for all users. However, there is much more to the historical debugger than just diagnostic events collection. For example, one of the more interesting features is that the debugging log can be saved off and opened in the debugger later on a different machine. You can see how diagnostic events would be highly useful in this scenario, as a tester could collected a low overhead log, attach it to the bug and then the developer could debug back in time to specific diagnostic events on their own machine at a later date. In my next blog posting I’ll be digging deeper into this log scenario and examining how it can help to solve the “no repro” issues that plague developer / tester communication.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9776784" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio+team+system/default.aspx">visual studio team system</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio/default.aspx">visual studio</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/2010/default.aspx">2010</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/historical+debugger/default.aspx">historical debugger</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/diagnostic+event/default.aspx">diagnostic event</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/microsoft/default.aspx">microsoft</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/beta+2/default.aspx">beta 2</category></item><item><title>Historical Debugging in Visual Studio Team System 2010</title><link>http://blogs.msdn.com/ianhu/archive/2009/05/13/historical-debugging-in-visual-studio-team-system-2010.aspx</link><pubDate>Thu, 14 May 2009 02:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9612402</guid><dc:creator>ianhu</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/ianhu/comments/9612402.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ianhu/commentrss.aspx?PostID=9612402</wfw:commentRss><description>&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;U&gt;&lt;SPAN style="LINE-HEIGHT: 115%; COLOR: windowtext; FONT-SIZE: 18pt"&gt;&lt;FONT face=Cambria&gt;Historical Debugging in Visual Studio Team System 2010&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/H2&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;What is Historical Debugging in a nutshell?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;If you’ve been in the development world for any length of time you’ve probably ended up in a situation like one of the following more than a few times.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;You’ve received reports of a crash from a tester, but on your local box you can’t get the bug to reproduce.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;You’ve received a crash dump from the tester along with the bug. But the callstack that actually caused the crash was just a cascading effect and you can’t trace the bug back to the root issue.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;The bug that you are currently working at resolving has an extremely long set of reproduction steps and you just accidentally stepped over the function that is returning bad data.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;You know that some part of your program is hitting the registry way too often,&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;but while stepping through all that you see are .Net framework calls and you are unable to isolate which of them is doing all the extra registry work.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;With &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Visual Studio 2010&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/visualstudio/en-us/products/teamsystem/default.mspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Team System Editions&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; we are introducing a new Historical Debugger aimed at getting rid of these developer pain points. The Historical Debugger plays a role similar to that of a &lt;/FONT&gt;&lt;A href="http://en.wikipedia.org/wiki/Flight_data_recorder"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;black box&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; in a plane. We keep track of important points in your programs execution and allow you to play back what happened at those points at a later time. We’re very proud of the current experience that we offer with the Visual Studio debugger so we’ve worked hard to surface all this new historical data in a way that is both useful and consistent with what you would expect from debugging in Visual Studio.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;A little more depth on the Historical Debugger&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;In the previous section I’ve mentioned some scenarios that the Historical Debugger is meant to help solve but I’ve not mentioned much about how the Historical Debugger actually works aside from the black box analogy. To get an overview about how the Historical Debugger actually works I’ll do a quick little rundown on what the Historical Debugger collects, when it collects it and how you can view this information after collecting it. I’m going to keep to rather general terms for now, but in later blog posts we’ll dig down deeper into each area and talk more about how to configure and use the Historical Debugger from within Visual Studio.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;What does the Historical Debugger collect?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Consider what you usually see in Visual Studio when you stop at a breakpoint during your program’s execution. At a basic level, you will probably see a source file with an arrow in the margin indicating where you currently are in program execution. You’ll probably also have access to a window showing your local and watch variables, a window showing your current callstack and some intellisense values for variables in your source code. Also, you might be digging into some more advanced windows like the threads window or the memory window available in the debugger. With a few notable exceptions the basic data that we will be collecting with the Historical Debugger will be a subset of the information normally available to you when doing standard live debugging.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The first thing that might strike you about this is “Isn’t collecting all this information going to slow down debugging my application by some crazy amount?” Trust me when I say that this worry is the proverbial &lt;/FONT&gt;&lt;A href="http://en.wikipedia.org/wiki/Damocles"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Sword of Damocles&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; that dangles over the head of our team. As big of an issue as this is, I think that we’ve come up with some pretty clever solutions to collect a useful amount of information without perturbing normal debugging patterns (more of these solutions will be mentioned in the “when does the Historical Debugger collect?” section below). A big part of this process was selecting what information is most commonly used during debugging but without picking anything that overly bloats our log files or slows down debugging too much. For starters, every time we stop to collect data we will grab your current code context and the current callstack. Second, we will get the value for any primitive data types that would appear in the locals or watch window at that point, we also get the primitive values for up to one level deep on any objects that would be in the locals or watch windows .Third, to the immense relief of those doing multi-threaded debugging, we will collect the data on the currently active threads.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;When does the Historical Debugger collect data?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Above, we’ve talked a little about the debugger information that the Historical Debugger collects. But now we need to address how often this information is collected. After all, even if we are collecting a tiny amount of information collecting it too often will quickly lead to your program being slowed down to a halt and generating massive log files. To make Historic Debugging useful we need to provide the user with some solid default settings for how often they collect data and allow for some tweaking to adjust these default values.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;When designing the Historical Debugger we based it around two main default levels of data collection. The first level of collection is based around the concept of collecting debugger data at specific points of interest in your program called diagnostic events. Diagnostic events are locations that we have selected as being common points of interest for customers when debugging a managed application. These diagnostic events are selected by Visual Studio and are meant to cover a broad range of programming types. An example diagnostic event that is included with the Historical Debugger would be RegistryKey.SetValue. If this diagnostic event is enabled you well collect a full set of Historical Debugging data every time that RegistryKey.SetValue gets called. These diagnostic events will act like checkpoints when you go back to examine your historical data. We of course allow for you to tweak which sets of diagnostic events will be enabled anytime you are debugging.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;We think that we’ve selected diagnostic events that will be useful across a broad range of scenarios, but there will be plenty of times where the area you are interested in debugging after the fact will not have any diagnostic events of interest in it. For this scenario we’ve added an option to also collect debugging data at all method entry points in your program. Also, in this mode we will collect additional data on the parameters that were passed into each method. As would be expected this mode will increase the overhead that the Historical Debugger creates, so be aware of the effect it will have on your applications performance when debugging. Overhead aside, we believe that the data collected in this mode can be very useful especially in that it give a better idea of the shape of your program as opposed to just diagnostic events.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;How do we show the Historical Debugger information?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;For the most part the Historical Debugger information will be shown in the normal debugger windows such as the watch window, the locals window and the thread window that you already know and love. Although as mentioned above we do only collect a subset of total debugger information, so don’t expect to see everything when debugging historically. When you are in the middle of a normal debug session you will be able to just step backward to the most recent diagnostic event (or method enter / callsite if you are collecting them) from there you will be able to move about between the various points that we collected data during your current debugging session. As we dig into the new historical debugging UI in later blog posts I’ll talk more about the features that we’ve integrated into VS to help make this navigation easier.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;In addition to being able to move back in time from a normal debugging session you can also save off historical debugging data in a separate .tdlog file and open this later or on another computer. This tdlog file is a key component of what we call the “no repro” scenario, the scenario in which testers pass off a bug to developers but developers are unable to recreate and debugger the error condition locally. We’ve provided integration with &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/jennifer/archive/2008/12/05/visual-studio-team-system-vsts-2010-making-testing-easier.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Camano&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; (our new standalone test case management tool) and &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/teamsystem/dd408382.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;TFS&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; to make it super easy for testers to attach tdlog files to any bugs that they file. Now when developers open up a bug they will be able to also open up the attached tdlog file and debug to any point where historical data was collected to help track down the issue.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=4 face=Cambria&gt;What’s next?&lt;/FONT&gt;&lt;/H2&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;This goal of this little intro was to tell you the very basics about the how the Historical Debugger works. In the upcoming weeks I’m going to start rolling out more articles that provide in-depth detail about how the Historical Debugger works and about how you can use it from Visual Studio 2010. Expect more pictures of how the UI will actually look and function as well as more samples about how Historical Debugging can help to solve common (and uncommon) programming issues.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9612402" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio+team+system/default.aspx">visual studio team system</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio/default.aspx">visual studio</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/developer/default.aspx">developer</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/tsbt-dev/default.aspx">tsbt-dev</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/team+system/default.aspx">team system</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/2010/default.aspx">2010</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/historical+debugger/default.aspx">historical debugger</category></item><item><title>Back To Blogging</title><link>http://blogs.msdn.com/ianhu/archive/2009/05/13/back-to-blogging.aspx</link><pubDate>Thu, 14 May 2009 02:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9612377</guid><dc:creator>ianhu</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/ianhu/comments/9612377.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ianhu/commentrss.aspx?PostID=9612377</wfw:commentRss><description>&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;U&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 18pt"&gt;&lt;FONT face=Calibri&gt;Back to Blogging&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/U&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;So for the last 18 months or so there has been nary a peep on this blog about anything. One contributing factor to this extended period of silence would happen to be the fact that I now have an 18 month old daughter and I was feeling a bit of a time crunch. But the actual big reason is that I moved teams within Visual Studio and was working on a project that was flying under the radar for about a year. This new product is the Historical Debugger that is going to be shipping with Visual Studio 2010 (I’ll have an introduction post up for this feature later today) and it’s much more out in the open now so I’m ready to start blogging up some hype for it. I’m still a part of the Visual Studio Diagnostics team and just down the hallway from my profiler ex-coworkers so I’m still around for answering / forwarding profiler questions. As before there will be a few odd-ball posting here and there, but in general just expect lots of information, samples and chat about the Historical Debugging feature.&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9612377" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio+team+system/default.aspx">visual studio team system</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/visual+studio/default.aspx">visual studio</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/developer/default.aspx">developer</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/team+system/default.aspx">team system</category><category domain="http://blogs.msdn.com/ianhu/archive/tags/2010/default.aspx">2010</category></item></channel></rss>