pdb
pdb copied to clipboard
How to get a symbol size?
I think the following should get you fairly close:
- Wait for PR #26 to land
- Iterate over all the modules
- Iterate over the symbols of each module
- The
ProcedureSymbols in each module have alenfield. That's your symbol size.
I've tried the pdb_symbols example, but I've got:
error dumping PDB: The requested stream (65535) is not stored in this file
The PDB file is from building the cargo-bloat with the MSVC target.
Also, I'm not familiar with the pdb, but what is the difference between global_symbols and symbols from debug_information? AFAIU, they can have the same symbols/functions, but global_symbols doesn't contain size.
In my case, I have to collect a list of functions (name + size) that are used in the executable.
Let me call a Windows expert for help here.
@retep998 Could you make some advises about above questions? Thank you!
I don't know anything about the PDB format, sorry.
Also, I'm not familiar with the
pdb, but what is the difference betweenglobal_symbolsand symbols fromdebug_information? AFAIU, they can have the same symbols/functions, butglobal_symbolsdoesn't contain size.
I think global_symbols only lists the symbols that are exposed to the linker. And the symbols in debug_information describe all functions present in the binary, even those that are internal and not callable from the outside.
global_symbols in this crate does not expose information from the "Global Symbol Stream", but instead from a "Symbol Records Stream". I wasn't able to fully understand what the exact differences are, but it looks like the latter contains a combination of the "Global Symbol Stream" and the "Public Symbol Stream", plus more additional information.
@RazrFalcon is this still an issue?
I should retest it.