I watched the “Debugging Tips and Tricks in Visual Studio 2013” session from TechEd and I found some very interesting debugging tips I was mainly unaware of.
Run to Cursor (CTRL + F10)
Run the debugger and stop in the location of your cursor. This allows you to debug your code from a particular location without the need to set a breakpoint. This is useful because often people create breakpoints but forget to remove them and the debugging becomes very slow.
When you are inspecting a variable and a DataTip is visible on the screen, you can press CTRL to make it temporarily transparent. This also works for Intellisense.
I usually use the Immediate Window to run some code in the middle of a debugging session. However, an another option is to just type a comment in the code, select it and inspect it. A DataTip will show the results of the execution. It is quite cool but I found that it does not work all the time.
Show Parameter Values
By default the Call Stack window does not show the value of parameters. This feature however can be very useful.
Step Into Specific
When you have a single statement with multiple method calls you can use Step Into Specific to jump into a specific method and start debugging from there.
When you have a single statement with multiple method calls the Autos windows shows the result of each individual call. This is extremely useful because you are not forced any more to create a temporary variable just for the sake of debugging.
You can print staff in the Output window all the time a particular breakpoint is hit using the When Hit feature. This is similar to manually add a Console.WriteLine but without the problem of remembering to remove it after the debugging session.
Break at Function
When you have multiple overrides of the same method instead of setting multiple breakpoints manually it is possible to set a function breakpoint. This is quite useful when you don’t know which particular override will be called.
Run Flagged Threads To Cursor
When you are doing multi threading programming it can be useful to put a breakpoint and break when all the selected threads arrive at a specific code location. You can then use the Parallel Stacks to explore all the stack calls, Tasks to explore the status of all the tasks and the Parallel Watch window to analyse the values of variables. You can also freeze some threads.