MolecularMatters / raw_pdb

A C++11 library for reading Microsoft Program DataBase PDB files
BSD 2-Clause "Simplified" License
675 stars 91 forks source link

Unhandled record kind 0x1179 #58

Closed graemekelly closed 1 year ago

graemekelly commented 1 year ago

I'm getting the above error when running the examples through ExampleFunctionVariables(). This trivial sample will reproduce it:

#include <utility>
#include <vector>

namespace
{
    using whatever_vector = std::vector<std::pair<int32_t, int32_t>>;
}

int main()
{
    whatever_vector temp;
    temp.emplace_back( 1, 2 );
    temp.emplace_back( 3, 4 );

    for ( auto& [one, two] : temp )
    {
        one += two;
    }

    return 0;
}

It's struggling with the variables used in the structured bindings. I can't find any documentation on 0x1179, and can't seem to figure out what it is. Any ideas?

It only happens if I try to examine a debug build, release works fine. It was last night's Twitter post about looking at pdb sizes that piqued my interest 😄

(I'm using Visual Studio 2022 version 17.7.3 here, Platform Toolset v143 - haven't been able to check other versions)

MolecularMatters commented 1 year ago

Seems like the compiler (understandably) keeps adding new record kinds/types for new(er) C++ language features, with these record kinds not being documented anywhere.

We'll check if we can find out the type or reach out to MSFT for this,

In the meantime, if you're interested in optimizing PDB sizes, simply only run the ExamplePDBSize for now and comment the rest.

graemekelly commented 1 year ago

Actually, just ran into a different repro for the same error:

namespace
{
    class base
    {
    };

    class derived1 : virtual public base
    {       
    };
}

int main()
{
    derived1 temp;
    return 0;
}

Virtual inheritance is the trigger here (obviously not needed in this instance) - was trying to find a repro for another error I'm getting with one of the other examples (will post a separate ticket if I figure it out).

JustasMasiulis commented 1 year ago

0x1179 is S_REGREL32_ENCTMP, should be same-ish to S_REGREL32

MolecularMatters commented 1 year ago

Thanks @JustasMasiulis for chiming in once again.

May I ask where you get that information from? Is there public information on this, is there another project on GitHub we aren't aware of, or do you work for Microsoft :) ?

JustasMasiulis commented 1 year ago

May I ask where you get that information from?

Reverse engineering of DIA.

Is there public information on this.

Nope, although finding out what the undocumented values are is not that hard.

is there another project on GitHub we aren't aware of, or do you work for Microsoft :) ?

I'm not affiliated with Microsoft.

lukekasz commented 1 year ago

I've fixed this issue in https://github.com/MolecularMatters/raw_pdb/pull/63

Test PDB: http://lukekasz.com/raw_pdb/record-kind-1179.pdb