summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-03-23 21:36:25 +0000
committerReid Kleckner <rnk@google.com>2017-03-23 21:36:25 +0000
commita5d187b0ffc91365b0dbcc391e24ca85d6907dec (patch)
treed77aa595b723a45c1c6f8646786f6f4c7d16c635 /llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
parentacffa28c6396dcf1e86232024f189db742f63770 (diff)
downloadbcm5719-llvm-a5d187b0ffc91365b0dbcc391e24ca85d6907dec.tar.gz
bcm5719-llvm-a5d187b0ffc91365b0dbcc391e24ca85d6907dec.zip
[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
Diffstat (limited to 'llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp')
-rw-r--r--llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp b/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
index d94b398e580..8348751703f 100644
--- a/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
+++ b/llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
@@ -459,9 +459,13 @@ Error LLVMOutputStyle::dumpTpiStream(uint32_t StreamIdx) {
P.printNumber("Record count", Tpi->NumTypeRecords());
}
- TypeDatabaseVisitor DBV(TypeDB);
- CompactTypeDumpVisitor CTDV(TypeDB, &P);
+ TypeDatabase &StreamDB = (StreamIdx == StreamTPI) ? TypeDB : ItemDB;
+
+ TypeDatabaseVisitor DBV(StreamDB);
+ CompactTypeDumpVisitor CTDV(StreamDB, &P);
TypeDumpVisitor TDV(TypeDB, &P, false);
+ if (StreamIdx == StreamIPI)
+ TDV.setItemDB(ItemDB);
RecordBytesVisitor RBV(P);
TypeDeserializer Deserializer;
OpenPOWER on IntegriCloud