Course info

Rating

(227)

Level

Intermediate

Updated

Mar 28, 2012

Duration

3h 40m

Description

This course teaches how to use the Visual Studio 2010 powerful debugging features to hunt down tough bugs. You might be surprised that Visual Studio contains super powerful debugging features that are invaluable when hunting down tough bugs. Topics such as data inspection, power tools, debugger canvas, threading and much more is explained. We even take a look at some of the new debugging features in Visual Studio 11 beta.

Section Introduction Transcripts

Data InspectionHi. I'm Mario Hewardt and welcome to the Data Inspection Module of the Introduction to. NET Debugging using Visual Studio 2010 course. Now, in this module, we're going to look at something that's really key task when it comes to debugging in general and that is looking at the state of an application to see if you can arrive at real cost for the particular problem you're debugging. So examples, what are the local variables? What are the values of the local variables and do they make sense? What's in memory in general? If I'm looking at a high memory situation, I need to kind of figure out in a high level overview of what's in memory. What's the code flow? It's a pretty basic one. And in general, just what is the state of the process right now and how did it get there and is it correct? So with that in mind, of course, the ease of data inspection is key if you want to do quick and effective debugging. Now, Visual Studio offers great data inspection features. We've got things like watch windows. Those are windows that you can look to inspect various pars of your app. Autos and locals, they are kind of a version of a watch window. We'll talk more about those later. Memory and registers allows you to inspect the state of memory and the process of registers. DataTips is another cool way of quickly finding out what the variable values are. And then we also have this window called the immediate window, which allows you to kind to write C# code while you are debugging to evaluate and see how things are progressing.

Visual Studio 2010 Debugging Power ToolsHi, I'm Mario Hewardt and welcome to the Power Tools or Power Features module of the introduction to. NET Debugging using Visual Studio course. Now what we're going to be talking about in this particular module is some pretty powerful and nifty features of the Visual Studio Debugger brings that can really help in your root cause analysis process. The first one we're going to talk about is something known as IntelliTrace. If you look at debugging as we've seen it so far or debugging that we most commonly think of it as is setting a breakpoint and being able to step forward in execution during that time. Well, what IntelliTrace brings to the table is the ability to also go backwards in time and it does so through a tracing mechanisms. So you can-- IntelliTrace can be best viewed as this form of historical debugging. It allows you to go both forward and backwards. The other thing I want to talk about is this thing known as SOS. An SOS is a debugger extension that comes with a lot of powerful commands but is most commonly used with the native debuggers. So Debugging Tools for Windows aka WinDbg. It turns out that you can actually load SOS in Visual Studio and use some of the commands in there. So we'll take a look at how about-- how you can go about doing that. And the last thing that I want to touch on is this notion of postmortem debugging which is something that Visual Studio introduced the ability to do postmortem debugging in 2010. And the best way to think about postmortem debugging is offline debugging. You generate the state of the process on some machine, bring that state over to a different machine and then do your postmortem debugging of that state on that different machine.

Debugger CanvasHi, my name is Mario Hewardt and welcome to the Debugger Canvas module of the introduction to. NET Debugging using Visual Studio Course. Now we've looked at the features in as far as debugging is concerned within Visual Studio and we also kind of looked at some of the power tools that are available as well. The tool or plug-in if you will that I want to talk about next is what's known as Debugger Canvas and this is something that is actually quite a revolutionary way of altering the debugging experience and it was created by Microsoft in collaboration with Brown University. If you look at debugging as we traditionally think of it, it typically involves setting some breakpoint, you get a call stack when that breakpoint hits, and the call stack has X number of frames, for example A calls function B, calls function C, calls function D and this can-- this-- it can be quite be a few frames and the call stack can be quite deep. Commonly what you'll do is you'll investigate these different frames. So you'll double click on one of the frames, it will bring up the source window. You'll kind of look at that, you'll double click another frame, it brings up another source window. Now over time we may not remember what the source code around that breakpoint was 10 frames ago that you looked at, and so now you got to double click again to go back to the very same source window. And so you kind of lose the overall picture if you will and you see it'll lose the overall flow of code. If you had an alternative approach that would enable a more easy way to see the whole picture, that would be great and that's exactly what Debugger Canvas provides you.