Debugging with Pdb file and source code in Visual Studio

I have a web project that sends from client code to a method in an external dll that has the source code and the pdb file of this external dll. What I would like to do is debug the external dll using the source code file and pdb. Visual Studio does not stop saying that no characters are loaded from the module.

0
source share
1 answer

To debug a dll, you always need a character file with the same version. When you debug your own applications, you usually don't need to worry about that.

But things happen in the background. Visual stuido allways places the symbol files in the debug folder when creating your application, and also downloads them as described in the Loading the symbols automatic section.

(When you distribute your application, you usually do not want to distribute these symbols, and therefore they will not be copied to the release directory, which you will change the build configuration for release.)

Loading manuell characters

If you want to manually load symbols, you can load them using the Modules dialog.

"Debug" -> "Windows" -> "Modules" .

You can right-click on the line, and there is the option "Load Symbols", which allows you to load the pdb file.

enter image description here

Download automatic characters

Visual studio also automatically downloads characters when they can be found in one of the following locations.

  • The location specified inside the DLL or executable file. (By default, if you created a DLL or executable file on your computer, the linker places the full path and file name of the associated .pdb file inside the DLL or executable file. First, the debugger checks to see if the file symbol is specified at the location specified inside the DLL or executable This is useful because you always have the characters available for the code you compiled on your computer.)

  • .pdb files that may be present in the same folder as the DLL or executable file.

  • Any local character cache folders.
  • Any network, Internet servers, or local symbol servers and locations that are specified, such as Microsoft Symbol Server, if enabled.

enter image description here

If you want to learn more about how symbols are used with visual studio, you can read this article about Understanding symbol files and Visual Studio's symbol settings .

+2
source

Source: https://habr.com/ru/post/1268704/


All Articles