Overview of Visual Studio debugger tools

The debugger is a Visual Studio tool that works as a background process to inspect the execution of a program. Breakpoints are used to notify the debugger to pause the execution of the program when it hits a certain line. Program database (PDB) files are used to store the debugging information. It stores the line number, DataTips information, and other related information of the source code, which are required to debug the application. Visual Studio then reads it to pause the debugging process and provide more details of the execution.

When you build the application in debug mode, the PDB file has more information than in release mode.

It is not definite that, in all cases, the debugger will work. There are certain situations when your debugging information is invalid, and, in those cases, the Visual Studio debugger will fail to attach to the running process; for example, if the binary version of your code is different than the actual code. This often happens when you've compiled your code and attached the binary in a modified version of the original code.

When you run your application in debug mode, you will see a different layout of the Visual Studio IDE. It automatically adjusts the window layout to provide you with a better environment for debugging.

In debug mode, you will not generally see the Solution Explorer, Team Explorer, Toolbox, and Properties window. Instead, Visual Studio creates a layout with C# Interactive, Call Stack, Diagnostics Tools, IntelliTrace, Watch window, Exception Settings, Immediate window, and all other related information:

In this chapter, we will demonstrate some of the important tools and techniques to master when it comes to code debugging.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.128.129