This article is a mirror article of machine translation, please click here to jump to the original article.

View: 36247|Reply: 2

[Source] vs What and why .pdb files are generated

[Copy link]
Posted on 1/16/2018 3:43:04 PM | | |
What is a PDB file for?

PDB files: What every developer must know

Example of PDB scenario:

.net/c# log4net error exception does not record the cause of the line number
http://www.itsvse.com/thread-3928-1-1.html
(Source: Architect)


What is a PDB file?

Most developers should know that PDB files are used to help with software debugging. But how exactly does he work, we may not be familiar with. This article describes the storage and contents of PDB files. It also describes how the debugger finds the PDB file corresponding to binay and how the debugger finds the source code file corresponding to binay. This article is for all Native and Managed developers.

Before we begin, let's define two terms: private build, which is used to denote a build generated on the developer's own machine; public build, which means a build generated on a public build machine. private build is relatively simple, because PDB and binay are in the same place, and usually the problems we have are about public build.  

The most important thing that all developers need to know is that "PDB files are just as important as source code", without which you can't even debug. For public build, the symbol server needs to store all the PDBs, and then when the user reports an error, the debugger can automatically find the corresponding PDB file in binay, and both Visual Studio and Windbg know how to access the symbol server. Before storing PDB and binay to the symbol server, you also need to source index the PDB run, which is to associate PDB and source.  

The next part assumes that the Symbol Server and Source Server Indexing are already set up. TFS2010 can be done as simply as source indexing and symbol server copying for a new build.

2. The content of the PDB file

Officially starting the content of PDB, PDB is not a publicly available file format, but Microsoft provides an API to help get data from PDB.

The Native C++ PDB contains the following information:
* public, private and static function addresses;
* The name and address of the global variable;
* Parameter and local variable names and offsets on the stack;
* typedefinitions of class, structure and data;
* Frame Pointer Omission data for traversing the native stack on x86;
* The name and number of lines in the source code file;

The .NET PDB contains only 2 parts of information:
* Source code file name and number of lines;
* and the name of the local variable;
* All other data is already included in the . NET Metadata;  





Previous:Visual Studio adds the powerful editing capabilities of Vim to make it difficult to prevent!
Next:SQL Server Sending Mail Using Databases (sp_send_dbmail)
Posted on 1/16/2018 3:44:18 PM |
 Landlord| Posted on 12/8/2022 9:44:33 PM |
VS 2022 sets up the project to generate a .pdb file
https://www.itsvse.com/thread-10397-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com