getsentry / pdb

A parser for Microsoft PDB (Program Database) debugging information
https://docs.rs/pdb/
Apache License 2.0
375 stars 67 forks source link

Changed ConstantSymbol::value to be a Variant #31

Closed rlabrecque closed 5 years ago

rlabrecque commented 5 years ago

As seen here: https://github.com/Microsoft/microsoft-pdb/blob/master/cvdump/dumpsym7.cpp#L3797

Without this change the name was missing or mangled on some constants as the data_length was pointing into the value.

rlabrecque commented 5 years ago

I'll fix up the tests if it's lookin like you'll merge this!

willglynn commented 5 years ago

Interesting and gross! Yes, please fix the test and I'll merge :-)

rlabrecque commented 5 years ago

I was pleasantly surprised to see the Variant code prototyping my initial handcrafted fix.

If there ever ends up being another use case for needing to know the size of a Variant, we should probably pull that out into a helper function.

I'll try to get to the tests this weekend, thanks for merging in everything else this week!

rlabrecque commented 5 years ago

PR Updated, I changed it quite a bit on top of the Rust 2018 commit. I pulled the variant size logic out into a function, saved us from exposing tpi::constants to symbol:: and just made things easier to understand.

willglynn commented 5 years ago

Merged, thanks!