Skip to content

NGEN-generated PDB support #153

@vvuk

Description

@vvuk

I'm working to improve some profiling tools (samply specifically) that uses the pdb create under the hood. Part of what I need is being able to handle symbols for .NET, specifically symbols from Crossgen2-built Ready 2 Run assemblies. I think that's where things are coming from anyway, anyway -- things that end in .ni.pdb, I think written here with some comments about DiaSymReader and other: https://github.com/dotnet/runtime/blob/fc76b1cac3f02cc9729f6682d6850fd7982e9fe5/src/coreclr/tools/aot/ILCompiler.Diagnostics/PdbWriter.cs#L199

Here's an example of this type of PDB, from Microsoft's symbol server: dotnet.ni.dll Also just in case, this isn't a Portable PDB, it's a normal PDB, but I think written in a very limited way. It's just the symbol information.

When read by the pdb create, these pdbs show up as having no section information. Which means it can't get an address map, which means that I end up with no way of translating RVA addresses to symbols. Section contribution information is there though, e.g. here's dia2dump -x:

*** SECTION CONTRIBUTION

    RVA        Address       Size    Module
  00001000  0001:00000000  00275000  C:\Users\cloudtest\AppData\Local\Temp\5egk1fj3.cpa\dotnet.dll
  00276000  0002:00000000  00034000  C:\Users\cloudtest\AppData\Local\Temp\5egk1fj3.cpa\dotnet.dll
  002AA000  0003:00000000  00004000  C:\Users\cloudtest\AppData\Local\Temp\5egk1fj3.cpa\dotnet.dll

These section contributions map directly to the 3 sections in the actual code dotnet.dll. I have no idea where dia2dump is getting the RVA from above, as it's not in the section contrib information. I do see in PdbWriter.cs some places where sections are written, but I have no idea where that info is going!

In case it's useful, there's one module in this PDB (again from dia2dump):

** Module: C:\Users\cloudtest\AppData\Local\Temp\5egk1fj3.cpa\dotnet.dll

CompilandDetails:
        Language: MSIL
        Target processor: ARM64
        Compiled for edit and continue: no
        Compiled without debugging info: no
        Compiled with LTCG: no
        Compiled with /bzalign: no
        Managed code present: no
        Compiled with /GS: no
        Compiled with /sdl: no
        Compiled with /hotpatch: no
        Converted by CVTCIL: no
        MSIL module: no
        Frontend Version: Major = 0, Minor = 0, Build = 0, QFE = 0
        Backend Version: Major = 8, Minor = 0, Build = 424, QFE = 16909
        Version string: Crossgen2 - 8.0.4+2d7eea252964e69be94cb9c847b371b23e4dd470

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions