getsentry / symbolic

Stack trace symbolication library written in Rust
https://github.com/getsentry/symbolic#readme
MIT License
458 stars 76 forks source link

Support full Windows PDB format for .NET #871

Open bruno-garcia opened 1 month ago

bruno-garcia commented 1 month ago

From: https://github.com/getsentry/team-ingest/issues/490

We have symbolication for the .NET Portable PDB format, and for the Windows PDB format with native code, but not for the Windows PDB format as used by .NET.

It would be useful to support this, so that we can symbolicate .NET Windows apps and libraries that are compiled using this debug format when symbols are not available client-side.

See https://learn.microsoft.com/dotnet/csharp/language-reference/compiler-options/code-generation#debugtype

Debug types full or pdbonly when compiled on Windows will generate a Windows PDB, not a Portable PDB. (The pdbonly option creates a variation which is more optimized for release builds, so both should be supported if possible.)

This applies both to .NET Framework and to .NET Core (and modern ".NET").

--

See attached zip containing two console app projects. One is .NET 6 and the other is .NET Framework 4.8.

~FullPDBProjects.zip~ file is lost, we'll find a replacement

In both projects, the Debug build was compiled with DebugType=full and the Release build was compiled with DebugType=pdbonly. (These are the default settings for .NET Framework out of the box.)

All .pdb files here are Windows format PDBs, not portable PDBs.

Also note that .NET 6 compiles a .dll containing the application code and a .exe "wrapper" program with the entrypoint. This is the new way since .NET Core 1.0. But .NET Framework compiles a single .exe containing all code and the entrypoint in a single file.

bruno-garcia commented 1 month ago

@jamescrosswell could you help with a sample build on Windows? The attached sample was lost due to the repo being deleted.

We should be able to get those Windows PDBs by building a .NET Console app on a Windows machine. It should be generating Windows PDBs as opposed to on Mac and Linux where it uses Portable PDBs.

jamescrosswell commented 1 day ago

ConsoleApp.zip

Apologies for the delay... see zip attached. Includes the source as well as:

loewenheim commented 1 day ago

Thank you very much!