- Finding symbols through --symfile
- More abilities: Functions, Blocks, GlobalVariables, LocalVariables, VariableTypes
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | ||
---|---|---|
127 | I am assuming this assert won't fire if we give this an ELF or MachO file or any file that doesn't contain PDB info? Every SymbolFile subclass gets to calculate its abilities on each file until on of them returns that they can handle all abilities, or until all plug-ins have had a chance to answer and then the best one is picked. Seems like this shouldn't be here? I can't remember what checks get run before SymbolFile::CalculateAbilities() is called... |
source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | ||
---|---|---|
108–125 | LLVM coding style dictates the use of early returns whenever possible. So this block should be changed to something like. auto module_sp = m_obj_file->GetModule(); if (!module_sp) return 0; FileSpec symfile = module_sp->GetSymbolFileSpec(); if (!symfile) return 0; error = loadDataForPDB(...); if (error) { llvm::consumeError(error); return 0; } // etc | |
141 | Similar thing here. Assign first, and then add: if (!enum_dbg_streams_up) break; | |
144 | if (stream_name != "SECTIONHEADERS") continue; | |
151–157 | Is this correct? If *any* of these 3 sections of present, then *all* of these capabilities are present? Shouldn't we be actually trying to query DIA for a global, local, or variable and then seeing what it returns? (Incidentally, it's easy to figure this out with the native PDB reader, since you can just look for the presence of a module symbol stream, globals stream, and/or TPI stream). |
source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | ||
---|---|---|
127 | Any ELF or MachO other than PDB or PECOFF will error when calling loadDataForEXE or loadDataForPDB and return before reaching the assertion. |
If a Symbols table is present then lldb can retrieve symbols for the types listed in PDBSym_Type. In other words, if we want symbolic information for a function then checking for the Symbols table is sufficient.
This looks better. Technically it's possible to break this with some weird PDBs but I don't think it's possible to do better without using the native reader.
LLVM coding style dictates the use of early returns whenever possible. So this block should be changed to something like.