Viladoman / StructLayout

Visual Studio Extension for C++ struct memory layout visualization
MIT License
476 stars 22 forks source link

Troublesome unions with PDB extraction #30

Open tomarnes268 opened 2 years ago

tomarnes268 commented 2 years ago

[Visual Studio Community 2022 v17.1.5 / Struct Layout v0.6.0, PDB extraction]

I don't think this is correct. image

It is impossible to interact with struct C when an array is introduced. image

It works fine with Clang extraction, but I'm running into some troubles with it not parsing my #includes properly.

Viladoman commented 2 years ago

Interesting! Thanks for letting me know.

It is strange that it is not bundling everything inside the top union. The DIA SDK, used to extract the symbols from the PDB, sometimes does not provide all the needed information, so in some cases I need to reconstruct what I can with the little info extracted. It can also be that I am using the sdk wrong or missing something.

I will investigate and give it a try when I have some spare time.

tomarnes268 commented 2 years ago

There's also a little bit of overlapping text under the right circumstances. image

Viladoman commented 1 year ago

I finally had a look into this yesterday. Sadly the DIA sdk is not reporting some of these intermediate unions. I need to investigate if I can use a different library, like raw_pdb, to read the pdbs and produce more stable results.