More and more unknown debug subsection kinds are being discovered
so we should make it possible to dump these and display the
bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305041
91177308-0d34-0410-b5e6-
96231b3b80d8
DebugSubsectionState &State) {
State.initialize(std::forward<T>(FragmentRange));
- for (const auto &L : FragmentRange) {
+ for (const DebugSubsectionRecord &L : FragmentRange) {
if (auto EC = visitDebugSubsection(L, V, State))
return EC;
}
DebugSubsectionKind Kind =
static_cast<DebugSubsectionKind>(uint32_t(Header->Kind));
- switch (Kind) {
- case DebugSubsectionKind::FileChecksums:
- case DebugSubsectionKind::Lines:
- case DebugSubsectionKind::InlineeLines:
- case DebugSubsectionKind::CrossScopeExports:
- case DebugSubsectionKind::CrossScopeImports:
- case DebugSubsectionKind::Symbols:
- case DebugSubsectionKind::StringTable:
- case DebugSubsectionKind::FrameData:
- break;
- default:
- llvm_unreachable("Unexpected debug fragment kind!");
- }
if (auto EC = Reader.readStreamRef(Info.Data, Header->Length))
return EC;
Info.Container = Container;
LazyRandomTypeCollection &IPI)
: P(P), TPI(TPI), IPI(IPI) {}
+ Error visitUnknown(DebugUnknownSubsectionRef &Unknown) override {
+ if (!opts::checkModuleSubsection(opts::ModuleSubsection::Unknown))
+ return Error::success();
+ DictScope DD(P, "Unknown");
+ P.printHex("Kind", static_cast<uint32_t>(Unknown.kind()));
+ ArrayRef<uint8_t> Data;
+ BinaryStreamReader Reader(Unknown.getData());
+ consumeError(Reader.readBytes(Data, Reader.bytesRemaining()));
+ P.printBinaryBlock("Data", Data);
+ return Error::success();
+ }
+
Error visitLines(DebugLinesSubsectionRef &Lines,
const DebugSubsectionState &State) override {
if (!opts::checkModuleSubsection(opts::ModuleSubsection::Lines))
clEnumValN(ModuleSubsection::Symbols, "symbols",
"Symbols (DEBUG_S_SYMBOLS subsection) (not typically "
"present in PDB file)"),
+ clEnumValN(ModuleSubsection::Unknown, "unknown",
+ "Any subsection not covered by another option"),
clEnumValN(ModuleSubsection::All, "all", "All known subsections")),
cl::cat(FileOptions), cl::sub(RawSubcommand), cl::sub(PdbToYamlSubcommand));
cl::opt<bool> DumpModuleSyms("module-syms", cl::desc("dump module symbols"),