getsentry / pdb

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

Add symbol type to be able to filter the symbols #58

Closed calixteman closed 4 years ago

calixteman commented 4 years ago

The goal of this patch is to be able to get the type of the symbol without parsing it. This should make easier filtering when iterating over symbols.

jan-auer commented 4 years ago

Would it suffice to just expose the symbol constants in a sub namespace? Parsing is generally very fast, and duplicating the mapping at this point might easily lead to oversight when implementing new types.

calixteman commented 4 years ago

The first thing I did was to copy/paste the constants and then filter on raw_kind() using the same "or" stuff between constants and I thought it wasn't nice to have to copy/paste some code to use a lib. But maybe you're right when saying: parsing is fast enough. I'll make some benches to see if there are significant differences.