Changeset View
Changeset View
Standalone View
Standalone View
llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
Show First 20 Lines • Show All 831 Lines • ▼ Show 20 Lines | Error DumpOutputStyle::dumpModuleSyms() { | ||||
AutoIndent Indent(P); | AutoIndent Indent(P); | ||||
if (!File.hasPDBDbiStream()) { | if (!File.hasPDBDbiStream()) { | ||||
P.formatLine("DBI Stream not present"); | P.formatLine("DBI Stream not present"); | ||||
return Error::success(); | return Error::success(); | ||||
} | } | ||||
ExitOnError Err("Unexpected error processing symbols: "); | ExitOnError Err("Unexpected error processing symbols: "); | ||||
auto &Ids = Err(initializeTypes(StreamIPI)); | |||||
auto &Types = Err(initializeTypes(StreamTPI)); | auto &Types = Err(initializeTypes(StreamTPI)); | ||||
iterateModules( | iterateModules( | ||||
File, P, 2, [&](uint32_t I, StringsAndChecksumsPrinter &Strings) { | File, P, 2, [&](uint32_t I, StringsAndChecksumsPrinter &Strings) { | ||||
auto ExpectedModS = getModuleDebugStream(File, I); | auto ExpectedModS = getModuleDebugStream(File, I); | ||||
if (!ExpectedModS) { | if (!ExpectedModS) { | ||||
P.formatLine("Error loading module stream {0}. {1}", I, | P.formatLine("Error loading module stream {0}. {1}", I, | ||||
toString(ExpectedModS.takeError())); | toString(ExpectedModS.takeError())); | ||||
return; | return; | ||||
} | } | ||||
ModuleDebugStreamRef &ModS = *ExpectedModS; | ModuleDebugStreamRef &ModS = *ExpectedModS; | ||||
SymbolVisitorCallbackPipeline Pipeline; | SymbolVisitorCallbackPipeline Pipeline; | ||||
SymbolDeserializer Deserializer(nullptr, CodeViewContainer::Pdb); | SymbolDeserializer Deserializer(nullptr, CodeViewContainer::Pdb); | ||||
MinimalSymbolDumper Dumper(P, opts::dump::DumpSymRecordBytes, Types); | MinimalSymbolDumper Dumper(P, opts::dump::DumpSymRecordBytes, Ids, | ||||
Types); | |||||
Pipeline.addCallbackToPipeline(Deserializer); | Pipeline.addCallbackToPipeline(Deserializer); | ||||
Pipeline.addCallbackToPipeline(Dumper); | Pipeline.addCallbackToPipeline(Dumper); | ||||
CVSymbolVisitor Visitor(Pipeline); | CVSymbolVisitor Visitor(Pipeline); | ||||
auto SS = ModS.getSymbolsSubstream(); | auto SS = ModS.getSymbolsSubstream(); | ||||
if (auto EC = | if (auto EC = | ||||
Visitor.visitSymbolStream(ModS.getSymbolArray(), SS.Offset)) { | Visitor.visitSymbolStream(ModS.getSymbolArray(), SS.Offset)) { | ||||
P.formatLine("Error while processing symbol records. {0}", | P.formatLine("Error while processing symbol records. {0}", | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | |||||
Error DumpOutputStyle::dumpSymbolsFromGSI(const GSIHashTable &Table, | Error DumpOutputStyle::dumpSymbolsFromGSI(const GSIHashTable &Table, | ||||
bool HashExtras) { | bool HashExtras) { | ||||
auto ExpectedSyms = File.getPDBSymbolStream(); | auto ExpectedSyms = File.getPDBSymbolStream(); | ||||
if (!ExpectedSyms) | if (!ExpectedSyms) | ||||
return ExpectedSyms.takeError(); | return ExpectedSyms.takeError(); | ||||
auto ExpectedTypes = initializeTypes(StreamTPI); | auto ExpectedTypes = initializeTypes(StreamTPI); | ||||
if (!ExpectedTypes) | if (!ExpectedTypes) | ||||
return ExpectedTypes.takeError(); | return ExpectedTypes.takeError(); | ||||
auto ExpectedIds = initializeTypes(StreamIPI); | |||||
if (!ExpectedIds) | |||||
return ExpectedIds.takeError(); | |||||
SymbolVisitorCallbackPipeline Pipeline; | SymbolVisitorCallbackPipeline Pipeline; | ||||
SymbolDeserializer Deserializer(nullptr, CodeViewContainer::Pdb); | SymbolDeserializer Deserializer(nullptr, CodeViewContainer::Pdb); | ||||
MinimalSymbolDumper Dumper(P, opts::dump::DumpSymRecordBytes, *ExpectedTypes); | MinimalSymbolDumper Dumper(P, opts::dump::DumpSymRecordBytes, *ExpectedIds, | ||||
*ExpectedTypes); | |||||
Pipeline.addCallbackToPipeline(Deserializer); | Pipeline.addCallbackToPipeline(Deserializer); | ||||
Pipeline.addCallbackToPipeline(Dumper); | Pipeline.addCallbackToPipeline(Dumper); | ||||
CVSymbolVisitor Visitor(Pipeline); | CVSymbolVisitor Visitor(Pipeline); | ||||
BinaryStreamRef SymStream = | BinaryStreamRef SymStream = | ||||
ExpectedSyms->getSymbolArray().getUnderlyingStream(); | ExpectedSyms->getSymbolArray().getUnderlyingStream(); | ||||
for (uint32_t PubSymOff : Table) { | for (uint32_t PubSymOff : Table) { | ||||
▲ Show 20 Lines • Show All 301 Lines • Show Last 20 Lines |