Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed .pdb debug symbol information into an .exe file in Visual Studio

I am experimenting an analysis tool that can analyze executable files with embedded debug symbol information in Windows. While trying this tool on several open source projects, I realize that most of the builds do not keep symbolic information in executable files. I am able to compile the source code with VS (2008), but the build normally keeps the debug information in a separated .pdb file, not in the .exe file (unfortunately I only want to read debug information from .exe file and not .pdb file :-().

Does anybody know a way to embed symbol debug information into a single .exe file using Visual Studio?

like image 852
Anh Cuong Avatar asked Aug 26 '10 16:08

Anh Cuong


People also ask

How do I add debug symbols in Visual Studio?

From Visual Studio, select Tools > Options > Debugging. Select Symbols from the list, and then select the + sign to add a new Azure DevOps symbol server location.

How do I debug exe in VS?

Just use File/Open Project/Solution, select EXE file and Open it. Then select Debug/Start debugging. The other option is to run the EXE first and then Select Debug/Attach to process.

How do I create a .PDB file in Visual Studio?

In a developer command prompt, you can use the mspdbcmf.exe tool to generate a full PDB from this limited PDB. In Visual Studio, use the Project or Build menu items for generating a full PDB file to create a full PDB for the project or solution.

What are .pdb files Visual Studio?

A program database file (extension . pdb) is a binary file that contains type and symbolic debugging information gathered over the course of compiling and linking the project. A PDB file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic, Visual C#, or JScript program with the /debug option.


2 Answers

I know this is a pretty old issue but this feature has recently been merged into Roslyn: https://github.com/dotnet/roslyn/issues/12390

like image 67
Shay Rojansky Avatar answered Sep 20 '22 14:09

Shay Rojansky


The MSDN says that it isn't possible.

It is not possible to create an .exe or .dll that contains debug information. Debug information is always placed in a .pdb file.

like image 27
Kunis Avatar answered Sep 20 '22 14:09

Kunis