getsentry / pdb

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

Add typing for ImageSectionHeader::characteristics #129

Closed jan-auer closed 2 years ago

jan-auer commented 2 years ago

SectionCharacteristics is implemented as a public newtype around the raw u32, giving access to the inner value in case flags are not implemented. The wrapper follows the same pattern used for flags in the TPI, which parses the flag values lazily.

There is special handling for the mutually exclusive alignment values, as well as the _NO_PAD flag. Otherwise, all flags are exposed directly as booleans.

Fixes https://github.com/willglynn/pdb/issues/106

jan-auer commented 2 years ago

The constants are intentionally not exposed yet, that will be dealt with at once for #120.

cc @mstange, in case you'd like changes before this goes in

mstange commented 2 years ago

Looks great to me, thank you!