by Tarun Arora – see credit at the end of the post

As part of the Visual Studio 2012 Update 1, improvements have been made to the debugger for loading symbols and source. The improvements can be broken down into 4 buckets:

  • Performance Improvements
  • No Source Landing Page
  • Load Symbols Context Menu
  • Source Symbol Dialog

Performance Improvements

Significant performance gain has been achieved by,

  • Caching symbols aggressively
  • Detecting bad symbol paths to bail out earlier

Previously a bad symbol path caused at least a 30 seconds delay before the request was timed out. The debugger is now tuned to identify cases causing long and unnecessary symbol loading delays such as a symbol server not being available, bad cache path, incorrect symbol server location, etc. The improvement makes it so that once a “bad situation” has been detected, the debugger will spend no more than a few seconds to time out. On average, 30 second time-outs have been reduced to just 3s once the problem is detected.

No Source Landing Page

While debugging if you don’t have the source file locally available or are missing the binary when dump debugging you are redirected to a “No Symbols Loaded” page. This page was fairly limited previously and often didn’t indicate why you were seeing this page rather than the source code. There are currently 10 different reasons that could bring up this page,

  1. Binary not loaded (dump debugging)
  2. Symbol not loaded
  3. Symbol not loaded because it’s not in the include list
  4. Symbol not loaded because it’s in the exclude list
  5. Symbol loading skipped for optimized modules with Just My Code enabled
  6. Source not found (or mismatched)
  7. Source not available in the .pdb file (E.g. Stripped symbol files that are from the MS Public symbol server)
  8. Stopped in external code with Just My Code enabled
  9. No code is running (some helper threads stick around but have no code. In jscript debugging, the main thread may not be running any jscript code)
  10. Symbol not loaded when looking at a thread in an IntelliTrace log file

After you have installed Visual Studio 2012 Update 1, you will notice that it takes significantly less time before you are redirected to the “No Symbols Loaded” page (remember, bad symbol paths are detected and bailed out early) and the page gives you valid reasoning on why it failed to load the source. The page has also been improved to allow you to find your pdb directly and have more information about what file the debugger is looking for rather than having to go to tools->options->debugger->symbols page to figure out and change settings.

clip_image002

Figure 1 – The screen shot shows the expected behaviour, if you hit an exception in code you don’t have the symbol path configured for yet

Load Symbols Context Menus

Previously the context menu relating to symbols numbered at around 9 total items. With Visual Studio 2012 Update 1 this has now been streamlined to 4 so as to reduce any confusion or friction a customer may have had with these menu items.

clip_image004

Figure 2 – Old Context Menu

clip_image006

Figure 3 – New Context menu

Source server dialog

If you have set up “Enable source server support” and start debugging Visual Studio will give you a Security Warning dialog as it attempts to load the source code from TFS.

clip_image008

Figure 4 – Enable Source Server support from Tools->Options->Debugging

Previously only the run or don’t run options were available on the security warning dialog. There was a lot of feedback from customers around disabling Visual Studio Source Server Security Warning Dialog (and there was a workaround as well). With Visual Studio 2012 Update 1 additional options have been added to the dialog to allow customers to accept this as a trusted command and not throw a security warning again.

clip_image010

Figure 5 – Security Warning dialog with additional options

In closing

There are other resources I recommend including:

We are monitoring the comments section below and looking forward to your questions and feedback.

Credit

Credit for this post goes to Tarun Arora (ALM MVP) who authored the content with the help and support of Marc Paine and other Visual Studio debugger team members. Tarun Arora is a Microsoft Certified professional developer for Enterprise Applications. He has extensively travelled around the world gaining experience learning and working in culturally diverse teams. Tarun has over 5 years of experience developing 'Energy Trading & Risk Management' solutions for leading Trading & Banking Enterprises. His passion for technology has earned him the Microsoft Community Contributor and Microsoft.