Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how primitive types are found #99

Open
nkaretnikov opened this issue Jan 12, 2021 · 1 comment
Open

Document how primitive types are found #99

nkaretnikov opened this issue Jan 12, 2021 · 1 comment

Comments

@nkaretnikov
Copy link

nkaretnikov commented Jan 12, 2021

Took me a bit to figure this out, so this might be useful for others.

Please consider mentioning something like this in the docstring of the find method of the TPI stream:

Note: if the type index is less than the minimum_index of the TPI stream (usually 0x1000), the type is determined by matching the type index against a predefined mapping of primitive types.
For example, 0x0022 corresponds to a 32-bit unsigned value.

https://github.com/Microsoft/microsoft-pdb/blob/082c5290e5aff028ae84e43affa8be717aa7af73/include/cvinfo.h#L328

This is an implementation detail, but it might save someone time when debugging. Before figuring it out, I suspected a parsing error in my code or an issue with the library, then an error in the internal code.

Note that I'm not using the type finder for the reasons mentioned in this comment, so others are less likely to bump into this. But I still think it might be a good thing to document.

@nkaretnikov
Copy link
Author

In general, llvm-pdbutil dump --all <PDB> is a good tool for debugging issues like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant