-
Notifications
You must be signed in to change notification settings - Fork 12
Dump extern "C" functions without parameters in signature #9
Comments
Do you have an example of a PDB which has this problem? |
Yeah, I've been testing against a simple test program: |
That program has, for example:
and all the other test* functions are normal C++ linkage. I've been comparing against the output of the stock Breakpad dump_syms to try to match it. |
I rebased the check-linkage branch: https://github.com/luser/dump_syms/tree/check-linkage |
Hmm, yes, very strange.
I'm not sure what it means that different symbols are apparently at the same address. Have test6, test7 and testC been inlined into wmain? Anyhow, it seems that the assumption that symbols can be looked up by just address is invalid I had an attempt at implementing looking them up by name instead, see 3bb706e, which seems to produce the right output for this test, and also addresses #11, but it needs to be improved to do the name lookup in a sensible way.
But now it occurs to me that this isn't right either, as the same function name could occur multiple times, mangled with different sets of parameters and also unmangled, so perhaps the lookup needs to be on both offset and function name |
I don't think they're inlined, if you look at the FUNC records (from either version of dump_syms) we get distinct addresses for testC and wmain (you can see in your output above). I just can't figure out how those correspond to the entries in the globals stream. |
Checking the set of PDBs from the MS symbol server that I have, I didn't find any other examples of this (duplicate symbols in the global symbol table with different addresses) Looking at the data above, it seems a simple heuristic which would give the expected data would be to use the last definition of each symbol (so _wmain = 000124c0 and the other definitions are ignored), but it's hard to know if this is the correct way to interpet things. |
For compatibility with Breakpad's dump_syms, we should figure out how to dump extern "C" functions without parameters in the function signature. I have an attempt at doing this in the check-linkage branch (71add3e), but it doesn't work properly. The PDB file I'm testing with has multiple records in the globals stream with the same address, and I don't know how to disambiguate them.
The text was updated successfully, but these errors were encountered: