getsentry / pdb

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

Question regarding `FieldAttributes::is_intro_virtual` #113

Open ergrelet opened 2 years ago

ergrelet commented 2 years ago

Hi,

I'm currently trying to write some code based on the pdb2hpp example. I'm having trouble detecting/reconstructing pure virtual methods correctly. It seems it's not possible to check for the pureintro (0x06) property only, like it's possible with the purevirt property (0x01): https://github.com/willglynn/pdb/blob/7c35c3c82fe42a0aa505c0715d57f68ee93196fb/src/tpi/data.rs#L627

What's the reason behind this merge (between property 0x04 and 0x06)? Am I missing something?

TrinityDevelopers commented 2 years ago

This appears to be because CV_MTintro and CV_MTpureintro can both refer to an intro virtual function. In my opinion the problem appears to be that the is_pure_virtual function doesn't check both CV_MTpurevirt and CV_MTpureintro properties since they both can refer to a pure virtual function.

ergrelet commented 2 years ago

Oh okay, interesting ... Well, I'm not sure what the intent of the API is, I was hoping @jan-auer could clarify. is_static, is_virtual and is_pure_virtual suggest that the intent is to let the user access the attributes separately, without abstracting/merging them.