Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

10-4 Episode 34: Debugger Enhancements and Improvements

Download

Right click “Save as…”

  • WMV (WMV Video)
  • MP3 (Audio only)
  • MP4 (iPhone, Android)
  • Mid Quality WMV (Lo-band, Mobile)

In this episode of 10-4, Jason Olson is joined by Andrew Hall and Brad Sullivan to take a look at some new enhancements and improvements made to the debugger and debugging experience in Visual Studio 2010.

[2:10] - Sticky Data Tips

[3:13] - Adding more values (including notes) to data tips

[4:44] - Breakpoints Window enhancements

[8:04] - Export and Import of Breakpoints and Data Tips

[10:40] - Threads Window enhancements

[14:39] - Dump debugging improvements

[24:50] - Integrated IL Interpreter

For more information on the Debugger and to stay up to speed with all sorts of goodness, make sure to check out the Debugger Team's blog.

For more information on Visual Studio 2010 and .NET Framework 4, make sure to download and check out the latest release of the Visual Studio 2010 Training Kit along with the Visual Studio 2010 Training Course right here on Channel 9.

For more 10-4 episodes, be sure to visit:
http://channel9.msdn.com/shows/10-4

10-4! Over and out!

Tags:

Follow the Discussion

  • Allan LindqvistaL_ Kinect ftw

    the datatips are really hot.. is there a what to bake them into the project so that they're presisted without exporting/importing?

  • They are saved as part of the project in the .suo file (which is user specific).  The import/export allows them to be backed up and shared, but they do persist between debugging/visual studio sessions.

  • Allan LindqvistaL_ Kinect ftw

    really? awsome Smiley

     

    now the only thing thats missing is a reflector style disassembly of code that has no symbols Smiley

  • Great quality on the recording, on this laptop the fullscreen is like sitting at the machine it was recorded on. Although I'd love to be able to sign-in and comment without interrupting playback. Grrr...

  • Is it possible to create managed mini-dump programmatically for later analysis (e.g. in catch block of exception handling routine)???

  • This might be covered somewhere else, or maybe I totally missed it, but when I get out of debug mode and go back into edit mode, I lose the info in the command window. 9 times out of ten I have important info in there that I need in edit mode (variable values, test code, etc. ) and I have to copy/paste it into notepad before stopping debug mode. Will we be able to keep Command Window open, with the info displayed, while in edit mode? Thanks.

  • Allan LindqvistaL_ Kinect ftw

    ths is something i'd also like to do Smiley

    my app might throw a minor error that dont bring dowwn the whole app but i'd still like to be able to debug later. also, are the mini dumps saved somewhere locally? if an app crashes it asks if i want to send the dump to you, but i'd like to be able to look at the dump my self Smiley

     

    also there seem to be some bugs with the data tips, when i try to erase (with backspace) or move the cursor with the arrows, the change is made in the actual code, not in the data tip.. perhaps you know about this already Smiley

  • aL_, the answer to your question is at: http://msdn.microsoft.com/en-us/library/bb787181(VS.85).aspx"> http://msdn.microsoft.com/en-us/library/bb787181(VS.85).aspx

     

    That article describes how you can collect local dumps for yourself to troubleshoot, instead of sending dumps of your custom programs to Microsoft, never to be heard from again. I should also mention that this is effectively the replacement for Dr. Watson on Vista and Windows 7 (and of course their Server counterparts).

     

    Corrector

     

  • This is not exactly what I am looking for, I need this for managed apps and the article you pointed out says "Applications that do their own custom crash reporting, including .NET applications, are not supported by this feature."

    What I would like is: When there is an exception in my app, create mini-dump and display "Sorry, error" to end user.

  • Allan LindqvistaL_ Kinect ftw

    cool, thanks Smiley

    however like mjurek my apps are managed, and also [to my dismay] the client computers are only running xp :/

    is there another way? perhaps you coulh start windbg programatically and have it capture a dump?

  • Probably the easiest way is to launch the sysinternals 'ProcDump' tool (see http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx) passing your process id on the command line. You may want to do this from an AppDomain.UnhandledException event, or from an exception filter written in IL/VB. If you write out the dump from a catch block, the original variables will be lost, though you will still have acess to any variables viewable from the catch block.

     

    The alternative to creating ProcDump/WinDbg is to P/Invoke to dbghelp!MiniDumpWriteDump. However, its not reliable to write a minidump file of your own process (calling MiniDumpWriteDump with hProcess/ProcessId = GetCurrentProcess()/GetCurrentProcessId()), and you will likely find the P/Invokes harder to get correct then a call to System.Diagnostics.Process.Start.

  • If you're running you application while debugging with Visual Studio, another option would be to automatically create the dumps using macros.

     

    Here's a simple example of how to create a macro that will create a dump on an unhandled exception:

    1)  Got to Tools -> Macros -> Macros IDE

    2)  In Project Explorer, open MyMacros ->EnvironmentEvents

    3)  In the left drop-down (will say "(General)" by default), select DebuggerEvents

    4)  In the right drop-down, select OnExceptionNotHandled.  This will create a new subroutine called DebuggerEvents_OnExceptionNotHandled.

    5)  Add the following code to the subroutine:

            MsgBox("Unhandled Exception, writing out a minidump")

            Dim dbg As EnvDTE80.Debugger2

            dbg = DTE.Debugger

            dbg.WriteMinidump("c:\dumps\macrodump.dmp", EnvDTE80.dbgMinidumpOption.dbgMinidumpNormal)

     

    You can customize this to meet your needs.  For example, you could add some logic to make it only write out dumps under certain conditions.  You could write out a dump with heap by replacing dbgMinidumpNormal with dbgMinidumpFull.  Or you could have this routine run OnExceptionThrown instead of OnExceptionNotHandled (again, adding some conditions on when to write the dump).

     

    I hope that helps.  It's always better to create a dump file from out of process.  While a call to dbghelp.dll!MiniDumpWriteDump on your own process won't fail, you may end up with a bad dump.  There are a few reasons for this.  The first is that the faulting process if often not in such a good state to begin with and any complicated call might fail.  If you're only worried about minor issues, then this may not apply here.  The second is that it will have a hard time getting the stack information correct for the calling thread.  For this reason, it is suggested that you spin off a seperate worker thread that will make the call to write out the dump.

  • I like having the time line provided next to the video.  Any chance of adding a way to jump directly to that part of the video?

  • The sample application used in this video is available for download from: http://code.msdn.microsoft.com/vsdbg10stockanalyzer

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.