llvm-project/llvm/tools/llvm-pdbdump
Reid Kleckner a5d187b0ff [PDB] Use two DBs when dumping the IPI stream
Summary:
When dumping these records from an object file section, we should use
only one type database. However, when dumping from a PDB, we should use
two: one for the type stream and one for the IPI stream.

Certain type records that normally live in the .debug$T object file
section get moved over to the IPI stream of the PDB file and they get
new indices.

So far, I've noticed that the MSVC linker always moves these records
into IPI:
- LF_FUNC_ID
- LF_MFUNC_ID
- LF_STRING_ID
- LF_SUBSTR_LIST
- LF_BUILDINFO
- LF_UDT_MOD_SRC_LINE

These records have index fields that can point into TPI or IPI. In
particular, LF_SUBSTR_LIST and LF_BUILDINFO point to LF_STRING_ID
records to describe compilation command lines.

I've modified the dumper to have an optional pointer to the item DB, and
to do type name lookup of these fields in that DB. See printItemIndex.
The result is that our pdbdump-headers.test is more faithful to the PDB
contents and the output is less confusing.

Reviewers: ruiu

Subscribers: amccarth, zturner, llvm-commits

Differential Revision: https://reviews.llvm.org/D31309

llvm-svn: 298649
2017-03-23 21:36:25 +00:00
..
fuzzer [PDB] Partial resubmit of r296215, which improved PDB Stream Library. 2017-02-27 22:11:43 +00:00
Analyze.cpp [pdb] Add a new command for analyzing hash collisions. 2017-02-01 18:30:22 +00:00
Analyze.h [pdb] Add a new command for analyzing hash collisions. 2017-02-01 18:30:22 +00:00
CMakeLists.txt Add the beginning of PDB diffing support. 2017-03-13 23:28:25 +00:00
CompactTypeDumpVisitor.cpp [llvm-pdbdump] Add a compact dump mode. 2017-01-12 22:28:15 +00:00
CompactTypeDumpVisitor.h [llvm-pdbdump] Add a compact dump mode. 2017-01-12 22:28:15 +00:00
Diff.cpp [PDB] Add support for parsing Flags from PDB Stream. 2017-03-16 20:19:11 +00:00
Diff.h Add the beginning of PDB diffing support. 2017-03-13 23:28:25 +00:00
LLVMBuild.txt [msf] Resubmit "Rename Msf -> MSF". 2016-07-29 20:56:36 +00:00
LLVMOutputStyle.cpp [PDB] Use two DBs when dumping the IPI stream 2017-03-23 21:36:25 +00:00
LLVMOutputStyle.h [PDB] Use two DBs when dumping the IPI stream 2017-03-23 21:36:25 +00:00
LinePrinter.cpp Add option to control whether llvm-pdbdump outputs in color 2017-03-23 15:28:15 +00:00
LinePrinter.h Add option to control whether llvm-pdbdump outputs in color 2017-03-23 15:28:15 +00:00
OutputStyle.h Update llvm-pdbdump to use subcommands. 2016-06-30 17:42:48 +00:00
PdbYaml.cpp [PDB] Add support for parsing Flags from PDB Stream. 2017-03-16 20:19:11 +00:00
PdbYaml.h [PDB] Add support for parsing Flags from PDB Stream. 2017-03-16 20:19:11 +00:00
PrettyBuiltinDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyBuiltinDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyClassDefinitionDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyClassDefinitionDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyCompilandDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyCompilandDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyEnumDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyEnumDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyExternalSymbolDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyExternalSymbolDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyFunctionDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyFunctionDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyTypeDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyTypeDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyTypedefDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyTypedefDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyVariableDumper.cpp [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
PrettyVariableDumper.h [CodeView/PDB] Rename a bunch of files. 2017-01-11 00:35:43 +00:00
StreamUtil.cpp Add the beginning of PDB diffing support. 2017-03-13 23:28:25 +00:00
StreamUtil.h Add the beginning of PDB diffing support. 2017-03-13 23:28:25 +00:00
YAMLOutputStyle.cpp [PDB] Add support for parsing Flags from PDB Stream. 2017-03-16 20:19:11 +00:00
YAMLOutputStyle.h [pdb] Write the Named Stream mapping to Yaml and binary. 2017-01-20 22:42:09 +00:00
YamlSerializationContext.h [CodeView] Hook up CodeViewRecordIO to type serialization path. 2016-11-08 22:24:53 +00:00
YamlSymbolDumper.cpp [llvm-pdbdump] Add support for dumping symbols from Yaml -> PDB. 2017-03-13 14:57:45 +00:00
YamlSymbolDumper.h [pdb] Dump Module Symbols to Yaml. 2016-10-08 01:12:01 +00:00
YamlTypeDumper.cpp [codeview] Use separate records for LF_SUBSTR_LIST and LF_ARGLIST 2017-03-22 01:37:38 +00:00
YamlTypeDumper.h [CodeView] Hook up CodeViewRecordIO to type serialization path. 2016-11-08 22:24:53 +00:00
llvm-pdbdump.cpp Add option to control whether llvm-pdbdump outputs in color 2017-03-23 15:28:15 +00:00
llvm-pdbdump.h [pdb] Write the module info and symbol record streams. 2017-03-15 22:18:53 +00:00