[pdb] Use MsfBuilder to handle the writing PDBs.
authorZachary Turner <zturner@google.com>
Fri, 15 Jul 2016 22:16:56 +0000 (22:16 +0000)
committerZachary Turner <zturner@google.com>
Fri, 15 Jul 2016 22:16:56 +0000 (22:16 +0000)
commitfaa554b2fd6c327cb9cc0ac9983bd3c178f2276c
tree7cb1be7bc7dfee1244fb8d6767036955aa276875
parent93be6e8c0ada7f77b93db16c81b2160f82780ae6
[pdb] Use MsfBuilder to handle the writing PDBs.

Previously we would read a PDB, then write some of it back out,
but write the directory, super block, and other pertinent metadata
back out unchanged.  This generates incorrect PDBs since the amount
of data written was not always the same as the amount of data read.

This patch changes things to use the newly introduced `MsfBuilder`
class to write out a correct and accurate set of Msf metadata for
the data *actually* written, which opens up the door for adding and
removing type records, symbol records, and other types of data to
an existing PDB.

llvm-svn: 275627
26 files changed:
llvm/include/llvm/DebugInfo/CodeView/StreamArray.h
llvm/include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h
llvm/include/llvm/DebugInfo/PDB/Raw/InfoStream.h
llvm/include/llvm/DebugInfo/PDB/Raw/InfoStreamBuilder.h
llvm/include/llvm/DebugInfo/PDB/Raw/MsfBuilder.h
llvm/include/llvm/DebugInfo/PDB/Raw/NameMapBuilder.h [new file with mode: 0644]
llvm/include/llvm/DebugInfo/PDB/Raw/PDBFile.h
llvm/include/llvm/DebugInfo/PDB/Raw/PDBFileBuilder.h
llvm/lib/DebugInfo/PDB/CMakeLists.txt
llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp
llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp
llvm/lib/DebugInfo/PDB/Raw/InfoStream.cpp
llvm/lib/DebugInfo/PDB/Raw/InfoStreamBuilder.cpp
llvm/lib/DebugInfo/PDB/Raw/MsfBuilder.cpp
llvm/lib/DebugInfo/PDB/Raw/NameMapBuilder.cpp [new file with mode: 0644]
llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
llvm/lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp
llvm/test/DebugInfo/PDB/pdbdump-headers.test
llvm/test/DebugInfo/PDB/pdbdump-write.test
llvm/test/DebugInfo/PDB/pdbdump-yaml.test
llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
llvm/tools/llvm-pdbdump/PdbYaml.cpp
llvm/tools/llvm-pdbdump/PdbYaml.h
llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp
llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
llvm/unittests/DebugInfo/PDB/MsfBuilderTest.cpp