llvm-project/llvm/lib/DebugInfo/CodeView
Zachary Turner 68e1919d14 [CodeView] Correctly compute the name of S_PROCREF symbols.
We have a function which switches on the type of a symbol record
to return a hardcoded offset into the record that contains the
symbol name.  Not all symbols have names to begin with, and for
those records we return -1 for the offset.

Names are used for various things.  Importantly for this particular
bug, a hash of the record name is used as a key for certain hash
tables which are serialied into the PDB file.  One of these hash
tables is for the global symbol stream, which is basically a
collection of S_PROCREF symbols which contain the name of the
symbol, a module, and an address offset.

However, for S_PROCREF symbols, the function to return the offset
of the name was returning -1: basically it wasn't implemented.
As a result of this, all global symbols were hashing to the same
value, essentially it was as if every single global symbol's name
was the empty string.

This manifests in the VS debugger when you try to call a function
(global or member, doesn't matter) through the immediate window
and the debugger simply reports an error because it can't find the
function.  This makes perfect sense, because it is hashing the name
for real, looking in the global symbol hash table, and there is only
1 entry there which corresponds to a symbol whose name is the empty
string.

Fixing this fixes the MSVC debugger in this case.

llvm-svn: 336024
2018-06-29 22:19:02 +00:00
..
AppendingTypeTableBuilder.cpp Split TypeTableBuilder into two classes. 2017-11-30 18:39:50 +00:00
CMakeLists.txt [CodeView] Teach clang to emit the .debug$H COFF section. 2017-12-13 22:33:58 +00:00
CVSymbolVisitor.cpp Remove redundant includes from lib/DebugInfo. 2017-12-13 21:30:49 +00:00
CVTypeVisitor.cpp Remove redundant includes from lib/DebugInfo. 2017-12-13 21:30:49 +00:00
CodeViewError.cpp
CodeViewRecordIO.cpp [codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueId 2017-07-17 23:59:44 +00:00
ContinuationRecordBuilder.cpp Fix non assert build warnings. 2017-11-28 18:50:08 +00:00
DebugChecksumsSubsection.cpp [Codeview/PDB] Rename some methods for clarity. 2018-03-22 17:37:28 +00:00
DebugCrossExSubsection.cpp [CodeView] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-29 00:05:44 +00:00
DebugCrossImpSubsection.cpp [DebugInfo] Change std::sort to llvm::sort in response to r327219 2018-04-01 16:18:49 +00:00
DebugFrameDataSubsection.cpp
DebugInlineeLinesSubsection.cpp [CodeView] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-29 00:05:44 +00:00
DebugLinesSubsection.cpp [CodeView] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-29 00:05:44 +00:00
DebugStringTableSubsection.cpp [DebugInfo] Change std::sort to llvm::sort in response to r327219 2018-04-13 19:50:51 +00:00
DebugSubsection.cpp
DebugSubsectionRecord.cpp [CodeView] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-29 00:05:44 +00:00
DebugSubsectionVisitor.cpp
DebugSymbolRVASubsection.cpp [CodeView] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-29 00:05:44 +00:00
DebugSymbolsSubsection.cpp
EnumTables.cpp CodeView: Provide a .def file with the register ids 2017-10-03 18:27:22 +00:00
Formatters.cpp [codeview] Fix YAML for LF_TYPESERVER2 by hoisting PDB_UniqueId 2017-07-17 23:59:44 +00:00
GlobalTypeTableBuilder.cpp [CodeView] Micro-optimizations to speed up type merging. 2018-01-30 17:12:04 +00:00
LLVMBuild.txt
LazyRandomTypeCollection.cpp Teach llvm-pdbutil to dump types from object files. 2017-12-05 23:58:18 +00:00
Line.cpp
MergingTypeTableBuilder.cpp [CodeView] Add support for content hashing CodeView type records. 2017-12-05 23:08:58 +00:00
RecordName.cpp [CodeView] Correctly compute the name of S_PROCREF symbols. 2018-06-29 22:19:02 +00:00
RecordSerialization.cpp [PDB] Improve GSI hash table dumping for publics and globals 2017-07-26 00:40:36 +00:00
SimpleTypeSerializer.cpp [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder. 2017-11-28 18:33:17 +00:00
StringsAndChecksums.cpp [llvm-pdbutil] Support dumping CodeView from object files. 2017-09-01 20:06:56 +00:00
SymbolDumper.cpp [CodeView] Initial support for emitting S_THUNK32 symbols for compiler... 2018-04-16 16:53:57 +00:00
SymbolRecordMapping.cpp
SymbolSerializer.cpp [PDB] Serialize records into a stack-allocated buffer. 2017-08-21 20:17:19 +00:00
TypeDumpVisitor.cpp Fix line endings (CR/LF -> LF) introduced by rL329613 2018-04-10 00:09:15 +00:00
TypeHashing.cpp Resubmit [pdb] Change /DEBUG:GHASH to emit 8 byte hashes." 2018-05-17 22:55:15 +00:00
TypeIndex.cpp
TypeIndexDiscovery.cpp [DebugInfo][COFF] Fix reading variable-length encoded records 2018-04-10 01:58:45 +00:00
TypeRecordMapping.cpp Fix line endings (CR/LF -> LF) introduced by rL329613 2018-04-10 00:09:15 +00:00
TypeStreamMerger.cpp [CodeView] Micro-optimizations to speed up type merging. 2018-01-30 17:12:04 +00:00
TypeTableCollection.cpp Remove redundant includes from lib/DebugInfo. 2017-12-13 21:30:49 +00:00