; RUN: llvm-pdbutil yaml2pdb -pdb=%t.1.pdb %p/Inputs/merge-ids-and-types-1.yaml
; RUN: llvm-pdbutil yaml2pdb -pdb=%t.2.pdb %p/Inputs/merge-ids-and-types-2.yaml
; RUN: llvm-pdbutil merge -pdb=%t.3.pdb %t.1.pdb %t.2.pdb
-; RUN: llvm-pdbutil raw -types %t.3.pdb | FileCheck -check-prefix=TPI-TYPES %s
-; RUN: llvm-pdbutil raw -ids %t.3.pdb | FileCheck -check-prefix=IPI-TYPES %s
+; RUN: llvm-pdbutil dump -types %t.3.pdb | FileCheck -check-prefix=TPI-TYPES %s
+; RUN: llvm-pdbutil dump -ids %t.3.pdb | FileCheck -check-prefix=IPI-TYPES %s
TPI-TYPES: Types (TPI Stream)
TPI-TYPES-NEXT: ============================================================
; RUN: llvm-pdbutil yaml2pdb -pdb=%t.1.pdb %p/Inputs/merge-ids-1.yaml
; RUN: llvm-pdbutil yaml2pdb -pdb=%t.2.pdb %p/Inputs/merge-ids-2.yaml
; RUN: llvm-pdbutil merge -pdb=%t.3.pdb %t.1.pdb %t.2.pdb
-; RUN: llvm-pdbutil raw -ids %t.3.pdb | FileCheck -check-prefix=MERGED %s
-; RUN: llvm-pdbutil raw -types %t.3.pdb | FileCheck -check-prefix=TPI-EMPTY %s
+; RUN: llvm-pdbutil dump -ids %t.3.pdb | FileCheck -check-prefix=MERGED %s
+; RUN: llvm-pdbutil dump -types %t.3.pdb | FileCheck -check-prefix=TPI-EMPTY %s
MERGED: Types (IPI Stream)
+; RUN: llvm-pdbutil yaml2pdb -pdb=%t.1.pdb %p/Inputs/merge-types-1.yaml
; RUN: llvm-pdbutil yaml2pdb -pdb=%t.2.pdb %p/Inputs/merge-types-2.yaml
; RUN: llvm-pdbutil merge -pdb=%t.3.pdb %t.1.pdb %t.2.pdb
-; RUN: llvm-pdbutil raw -types %t.3.pdb | FileCheck -check-prefix=MERGED %s
+; RUN: llvm-pdbutil dump -types %t.3.pdb | FileCheck -check-prefix=MERGED %s
MERGED: Types (TPI Stream)
-; RUN: llvm-pdbutil raw -block-data=0 %p/Inputs/empty.pdb | FileCheck --check-prefix=BLOCK0 %s
-; RUN: llvm-pdbutil raw -block-data=0-1 %p/Inputs/empty.pdb | FileCheck --check-prefix=BLOCK01 %s
-; RUN: not llvm-pdbutil raw -block-data=0,1 %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=BADSYNTAX %s
-; RUN: not llvm-pdbutil raw -block-data=0a1 %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=BADSYNTAX %s
-; RUN: not llvm-pdbutil raw -block-data=0- %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=BADSYNTAX %s
+; RUN: llvm-pdbutil dump -block-data=0 %p/Inputs/empty.pdb | FileCheck --check-prefix=BLOCK0 %s
+; RUN: llvm-pdbutil dump -block-data=0-1 %p/Inputs/empty.pdb | FileCheck --check-prefix=BLOCK01 %s
+; RUN: not llvm-pdbutil dump -block-data=0,1 %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=BADSYNTAX %s
+; RUN: not llvm-pdbutil dump -block-data=0a1 %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=BADSYNTAX %s
+; RUN: not llvm-pdbutil dump -block-data=0- %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=BADSYNTAX %s
BLOCK0: MSF Blocks
BLOCK0-NEXT: ============================================================
-; RUN: llvm-pdbutil raw -stream-data=1 %p/Inputs/empty.pdb | FileCheck --check-prefix=STREAM %s
-; RUN: llvm-pdbutil raw -stream-data=100 %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=INVALIDSTREAM %s
-; RUN: llvm-pdbutil raw -stream-data=1,100 %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=BOTH %s
+; RUN: llvm-pdbutil dump -stream-data=1 %p/Inputs/empty.pdb | FileCheck --check-prefix=STREAM %s
+; RUN: llvm-pdbutil dump -stream-data=100 %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=INVALIDSTREAM %s
+; RUN: llvm-pdbutil dump -stream-data=1,100 %p/Inputs/empty.pdb 2>&1 | FileCheck --check-prefix=BOTH %s
STREAM: Stream Data
STREAM-NEXT: ============================================================
RUN: -stream-metadata %p/Inputs/empty.pdb > %t.1
RUN: llvm-pdbutil yaml2pdb -pdb=%t.2 %t.1
-RUN: llvm-pdbutil raw -summary -string-table -types %p/Inputs/empty.pdb | FileCheck %s
-RUN: llvm-pdbutil raw -summary -string-table -types %t.2 | FileCheck %s
+RUN: llvm-pdbutil dump -summary -string-table -types %p/Inputs/empty.pdb | FileCheck %s
+RUN: llvm-pdbutil dump -summary -string-table -types %t.2 | FileCheck %s
CHECK: Summary
add_llvm_tool(llvm-pdbutil
Analyze.cpp
Diff.cpp
+ DumpOutputStyle.cpp
llvm-pdbutil.cpp
FormatUtil.cpp
LinePrinter.cpp
PrettyTypeDumper.cpp
PrettyTypedefDumper.cpp
PrettyVariableDumper.cpp
- RawOutputStyle.cpp
StreamUtil.cpp
YAMLOutputStyle.cpp
)
-//===- RawOutputStyle.cpp ------------------------------------ *- C++ --*-===//
+//===- DumpOutputStyle.cpp ------------------------------------ *- C++ --*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-#include "RawOutputStyle.h"
+#include "DumpOutputStyle.h"
#include "FormatUtil.h"
#include "MinimalSymbolDumper.h"
using namespace llvm::msf;
using namespace llvm::pdb;
-RawOutputStyle::RawOutputStyle(PDBFile &File)
+DumpOutputStyle::DumpOutputStyle(PDBFile &File)
: File(File), P(2, false, outs()) {}
-Error RawOutputStyle::dump() {
- if (opts::raw::DumpSummary) {
+Error DumpOutputStyle::dump() {
+ if (opts::dump::DumpSummary) {
if (auto EC = dumpFileSummary())
return EC;
P.NewLine();
}
- if (opts::raw::DumpStreams) {
+ if (opts::dump::DumpStreams) {
if (auto EC = dumpStreamSummary())
return EC;
P.NewLine();
}
- if (opts::raw::DumpBlockRange.hasValue()) {
+ if (opts::dump::DumpBlockRange.hasValue()) {
if (auto EC = dumpBlockRanges())
return EC;
P.NewLine();
}
- if (!opts::raw::DumpStreamData.empty()) {
+ if (!opts::dump::DumpStreamData.empty()) {
if (auto EC = dumpStreamBytes())
return EC;
P.NewLine();
}
- if (opts::raw::DumpStringTable) {
+ if (opts::dump::DumpStringTable) {
if (auto EC = dumpStringTable())
return EC;
P.NewLine();
}
- if (opts::raw::DumpModules) {
+ if (opts::dump::DumpModules) {
if (auto EC = dumpModules())
return EC;
}
- if (opts::raw::DumpModuleFiles) {
+ if (opts::dump::DumpModuleFiles) {
if (auto EC = dumpModuleFiles())
return EC;
}
- if (opts::raw::DumpLines) {
+ if (opts::dump::DumpLines) {
if (auto EC = dumpLines())
return EC;
}
- if (opts::raw::DumpInlineeLines) {
+ if (opts::dump::DumpInlineeLines) {
if (auto EC = dumpInlineeLines())
return EC;
}
- if (opts::raw::DumpXmi) {
+ if (opts::dump::DumpXmi) {
if (auto EC = dumpXmi())
return EC;
}
- if (opts::raw::DumpXme) {
+ if (opts::dump::DumpXme) {
if (auto EC = dumpXme())
return EC;
}
- if (opts::raw::DumpTypes || opts::raw::DumpTypeExtras) {
+ if (opts::dump::DumpTypes || opts::dump::DumpTypeExtras) {
if (auto EC = dumpTpiStream(StreamTPI))
return EC;
}
- if (opts::raw::DumpIds || opts::raw::DumpIdExtras) {
+ if (opts::dump::DumpIds || opts::dump::DumpIdExtras) {
if (auto EC = dumpTpiStream(StreamIPI))
return EC;
}
- if (opts::raw::DumpPublics) {
+ if (opts::dump::DumpPublics) {
if (auto EC = dumpPublics())
return EC;
}
- if (opts::raw::DumpSymbols) {
+ if (opts::dump::DumpSymbols) {
if (auto EC = dumpModuleSyms())
return EC;
}
- if (opts::raw::DumpSectionContribs) {
+ if (opts::dump::DumpSectionContribs) {
if (auto EC = dumpSectionContribs())
return EC;
}
- if (opts::raw::DumpSectionMap) {
+ if (opts::dump::DumpSectionMap) {
if (auto EC = dumpSectionMap())
return EC;
}
P.formatLine("{0}", fmt_repeat('=', 60));
}
-Error RawOutputStyle::dumpFileSummary() {
+Error DumpOutputStyle::dumpFileSummary() {
printHeader(P, "Summary");
ExitOnError Err("Invalid PDB Format");
return Error::success();
}
-Error RawOutputStyle::dumpStreamSummary() {
+Error DumpOutputStyle::dumpStreamSummary() {
printHeader(P, "Streams");
if (StreamPurposes.empty())
return Error::success();
}
-Error RawOutputStyle::dumpBlockRanges() {
+Error DumpOutputStyle::dumpBlockRanges() {
printHeader(P, "MSF Blocks");
- auto &R = *opts::raw::DumpBlockRange;
+ auto &R = *opts::dump::DumpBlockRange;
uint32_t Max = R.Max.getValueOr(R.Min);
AutoIndent Indent(P);
return Error::success();
}
-Error RawOutputStyle::dumpStreamBytes() {
+Error DumpOutputStyle::dumpStreamBytes() {
if (StreamPurposes.empty())
discoverStreamPurposes(File, StreamPurposes);
printHeader(P, "Stream Data");
ExitOnError Err("Unexpected error reading stream data");
- for (auto &Str : opts::raw::DumpStreamData) {
+ for (auto &Str : opts::dump::DumpStreamData) {
uint32_t SI = 0;
uint32_t Begin = 0;
uint32_t Size = 0;
});
}
-Error RawOutputStyle::dumpModules() {
+Error DumpOutputStyle::dumpModules() {
printHeader(P, "Modules");
AutoIndent Indent(P);
return Error::success();
}
-Error RawOutputStyle::dumpModuleFiles() {
+Error DumpOutputStyle::dumpModuleFiles() {
printHeader(P, "Files");
ExitOnError Err("Unexpected error processing modules");
}
}
-Error RawOutputStyle::dumpLines() {
+Error DumpOutputStyle::dumpLines() {
printHeader(P, "Lines");
uint32_t LastModi = UINT32_MAX;
return Error::success();
}
-Error RawOutputStyle::dumpInlineeLines() {
+Error DumpOutputStyle::dumpInlineeLines() {
printHeader(P, "Inlinee Lines");
iterateModuleSubsections<DebugInlineeLinesSubsectionRef>(
return Error::success();
}
-Error RawOutputStyle::dumpXmi() {
+Error DumpOutputStyle::dumpXmi() {
printHeader(P, "Cross Module Imports");
iterateModuleSubsections<DebugCrossModuleImportsSubsectionRef>(
File, P, 2,
return Error::success();
}
-Error RawOutputStyle::dumpXme() {
+Error DumpOutputStyle::dumpXme() {
printHeader(P, "Cross Module Exports");
iterateModuleSubsections<DebugCrossModuleExportsSubsectionRef>(
return Error::success();
}
-Error RawOutputStyle::dumpStringTable() {
+Error DumpOutputStyle::dumpStringTable() {
printHeader(P, "String Table");
AutoIndent Indent(P);
return Error::success();
}
-Error RawOutputStyle::dumpTpiStream(uint32_t StreamIdx) {
+Error DumpOutputStyle::dumpTpiStream(uint32_t StreamIdx) {
assert(StreamIdx == StreamTPI || StreamIdx == StreamIPI);
bool Present = false;
if (StreamIdx == StreamTPI) {
printHeader(P, "Types (TPI Stream)");
Present = File.hasPDBTpiStream();
- DumpTypes = opts::raw::DumpTypes;
- DumpBytes = opts::raw::DumpTypeData;
- DumpExtras = opts::raw::DumpTypeExtras;
- Indices.assign(opts::raw::DumpTypeIndex.begin(),
- opts::raw::DumpTypeIndex.end());
+ DumpTypes = opts::dump::DumpTypes;
+ DumpBytes = opts::dump::DumpTypeData;
+ DumpExtras = opts::dump::DumpTypeExtras;
+ Indices.assign(opts::dump::DumpTypeIndex.begin(),
+ opts::dump::DumpTypeIndex.end());
} else if (StreamIdx == StreamIPI) {
printHeader(P, "Types (IPI Stream)");
Present = File.hasPDBIpiStream();
- DumpTypes = opts::raw::DumpIds;
- DumpBytes = opts::raw::DumpIdData;
- DumpExtras = opts::raw::DumpIdExtras;
- Indices.assign(opts::raw::DumpIdIndex.begin(),
- opts::raw::DumpIdIndex.end());
+ DumpTypes = opts::dump::DumpIds;
+ DumpBytes = opts::dump::DumpIdData;
+ DumpExtras = opts::dump::DumpIdExtras;
+ Indices.assign(opts::dump::DumpIdIndex.begin(),
+ opts::dump::DumpIdIndex.end());
}
AutoIndent Indent(P);
}
Expected<codeview::LazyRandomTypeCollection &>
-RawOutputStyle::initializeTypes(uint32_t SN) {
+DumpOutputStyle::initializeTypes(uint32_t SN) {
auto &TypeCollection = (SN == StreamTPI) ? TpiTypes : IpiTypes;
auto Tpi =
(SN == StreamTPI) ? File.getPDBTpiStream() : File.getPDBIpiStream();
return *TypeCollection;
}
-Error RawOutputStyle::dumpModuleSyms() {
+Error DumpOutputStyle::dumpModuleSyms() {
printHeader(P, "Symbols");
AutoIndent Indent(P);
SymbolVisitorCallbackPipeline Pipeline;
SymbolDeserializer Deserializer(nullptr, CodeViewContainer::Pdb);
- MinimalSymbolDumper Dumper(P, opts::raw::DumpSymRecordBytes, Types);
+ MinimalSymbolDumper Dumper(P, opts::dump::DumpSymRecordBytes, Types);
Pipeline.addCallbackToPipeline(Deserializer);
Pipeline.addCallbackToPipeline(Dumper);
return Error::success();
}
-Error RawOutputStyle::dumpPublics() {
+Error DumpOutputStyle::dumpPublics() {
printHeader(P, "Public Symbols");
AutoIndent Indent(P);
auto &Publics = Err(File.getPDBPublicsStream());
SymbolVisitorCallbackPipeline Pipeline;
SymbolDeserializer Deserializer(nullptr, CodeViewContainer::Pdb);
- MinimalSymbolDumper Dumper(P, opts::raw::DumpSymRecordBytes, Types);
+ MinimalSymbolDumper Dumper(P, opts::dump::DumpSymRecordBytes, Types);
Pipeline.addCallbackToPipeline(Deserializer);
Pipeline.addCallbackToPipeline(Dumper);
return typesetItemList(Opts, IndentLevel, 4, " | ");
}
-Error RawOutputStyle::dumpSectionContribs() {
+Error DumpOutputStyle::dumpSectionContribs() {
printHeader(P, "Section Contributions");
ExitOnError Err("Error dumping publics stream");
return Error::success();
}
-Error RawOutputStyle::dumpSectionMap() {
+Error DumpOutputStyle::dumpSectionMap() {
printHeader(P, "Section Map");
ExitOnError Err("Error dumping section map");
-//===- RawOutputStyle.h -------------------------------------- *- C++ --*-===//
+//===- DumpOutputStyle.h -------------------------------------- *- C++ --*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_TOOLS_LLVMPDBDUMP_RAWOUTPUTSTYLE_H
-#define LLVM_TOOLS_LLVMPDBDUMP_RAWOUTPUTSTYLE_H
+#ifndef LLVM_TOOLS_LLVMPDBDUMP_DUMPOUTPUTSTYLE_H
+#define LLVM_TOOLS_LLVMPDBDUMP_DUMPOUTPUTSTYLE_H
#include "LinePrinter.h"
#include "OutputStyle.h"
}
namespace pdb {
-class RawOutputStyle : public OutputStyle {
+class DumpOutputStyle : public OutputStyle {
public:
- RawOutputStyle(PDBFile &File);
+ DumpOutputStyle(PDBFile &File);
Error dump() override;
#include "Analyze.h"
#include "Diff.h"
+#include "DumpOutputStyle.h"
#include "LinePrinter.h"
#include "OutputStyle.h"
#include "PrettyCompilandDumper.h"
#include "PrettyFunctionDumper.h"
#include "PrettyTypeDumper.h"
#include "PrettyVariableDumper.h"
-#include "RawOutputStyle.h"
#include "YAMLOutputStyle.h"
#include "llvm/ADT/ArrayRef.h"
namespace opts {
-cl::SubCommand RawSubcommand("raw", "Dump raw structure of the PDB file");
+cl::SubCommand DumpSubcommand("dump", "Dump MSF and CodeView debug info");
cl::SubCommand
PrettySubcommand("pretty",
"Dump semantic information about types and symbols");
cl::OptionCategory FileOptions("Module & File Options");
-namespace raw {
+namespace dump {
cl::OptionCategory MsfOptions("MSF Container Options");
cl::OptionCategory TypeOptions("Type Record Options");
// MSF OPTIONS
cl::opt<bool> DumpSummary("summary", cl::desc("dump file summary"),
- cl::cat(MsfOptions), cl::sub(RawSubcommand));
+ cl::cat(MsfOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpStreams("streams",
cl::desc("dump summary of the PDB streams"),
- cl::cat(MsfOptions), cl::sub(RawSubcommand));
+ cl::cat(MsfOptions), cl::sub(DumpSubcommand));
cl::opt<std::string>
DumpBlockRangeOpt("block-data", cl::value_desc("start[-end]"),
cl::desc("Dump binary data from specified range."),
- cl::cat(MsfOptions), cl::sub(RawSubcommand));
+ cl::cat(MsfOptions), cl::sub(DumpSubcommand));
llvm::Optional<BlockRange> DumpBlockRange;
cl::list<std::string>
DumpStreamData("stream-data", cl::CommaSeparated, cl::ZeroOrMore,
cl::desc("Dump binary data from specified streams. Format "
"is SN[:Start][@Size]"),
- cl::cat(MsfOptions), cl::sub(RawSubcommand));
+ cl::cat(MsfOptions), cl::sub(DumpSubcommand));
// TYPE OPTIONS
cl::opt<bool> DumpTypes("types",
cl::desc("dump CodeView type records from TPI stream"),
- cl::cat(TypeOptions), cl::sub(RawSubcommand));
+ cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpTypeData(
"type-data",
cl::desc("dump CodeView type record raw bytes from TPI stream"),
- cl::cat(TypeOptions), cl::sub(RawSubcommand));
+ cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpTypeExtras("type-extras",
cl::desc("dump type hashes and index offsets"),
- cl::cat(TypeOptions), cl::sub(RawSubcommand));
+ cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::list<uint32_t> DumpTypeIndex(
"type-index", cl::ZeroOrMore,
cl::desc("only dump types with the specified hexadecimal type index"),
- cl::cat(TypeOptions), cl::sub(RawSubcommand));
+ cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpIds("ids",
cl::desc("dump CodeView type records from IPI stream"),
- cl::cat(TypeOptions), cl::sub(RawSubcommand));
+ cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::opt<bool>
DumpIdData("id-data",
cl::desc("dump CodeView type record raw bytes from IPI stream"),
- cl::cat(TypeOptions), cl::sub(RawSubcommand));
+ cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpIdExtras("id-extras",
cl::desc("dump id hashes and index offsets"),
- cl::cat(TypeOptions), cl::sub(RawSubcommand));
+ cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::list<uint32_t> DumpIdIndex(
"id-index", cl::ZeroOrMore,
cl::desc("only dump ids with the specified hexadecimal type index"),
- cl::cat(TypeOptions), cl::sub(RawSubcommand));
+ cl::cat(TypeOptions), cl::sub(DumpSubcommand));
// SYMBOL OPTIONS
cl::opt<bool> DumpPublics("publics", cl::desc("dump Publics stream data"),
- cl::cat(SymbolOptions), cl::sub(RawSubcommand));
+ cl::cat(SymbolOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpSymbols("symbols", cl::desc("dump module symbols"),
- cl::cat(SymbolOptions), cl::sub(RawSubcommand));
+ cl::cat(SymbolOptions), cl::sub(DumpSubcommand));
cl::opt<bool>
DumpSymRecordBytes("sym-data",
cl::desc("dump CodeView symbol record raw bytes"),
- cl::cat(SymbolOptions), cl::sub(RawSubcommand));
+ cl::cat(SymbolOptions), cl::sub(DumpSubcommand));
// MODULE & FILE OPTIONS
cl::opt<bool> DumpModules("modules", cl::desc("dump compiland information"),
- cl::cat(FileOptions), cl::sub(RawSubcommand));
+ cl::cat(FileOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpModuleFiles(
"files",
cl::desc("Dump the source files that contribute to each module's."),
- cl::cat(FileOptions), cl::sub(RawSubcommand));
+ cl::cat(FileOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpLines(
"l",
cl::desc("dump source file/line information (DEBUG_S_LINES subsection)"),
- cl::cat(FileOptions), cl::sub(RawSubcommand));
+ cl::cat(FileOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpInlineeLines(
"il",
cl::desc("dump inlinee line information (DEBUG_S_INLINEELINES subsection)"),
- cl::cat(FileOptions), cl::sub(RawSubcommand));
+ cl::cat(FileOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpXmi(
"xmi",
cl::desc(
"dump cross module imports (DEBUG_S_CROSSSCOPEIMPORTS subsection)"),
- cl::cat(FileOptions), cl::sub(RawSubcommand));
+ cl::cat(FileOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpXme(
"xme",
cl::desc(
"dump cross module exports (DEBUG_S_CROSSSCOPEEXPORTS subsection)"),
- cl::cat(FileOptions), cl::sub(RawSubcommand));
+ cl::cat(FileOptions), cl::sub(DumpSubcommand));
// MISCELLANEOUS OPTIONS
cl::opt<bool> DumpStringTable("string-table", cl::desc("dump PDB String Table"),
- cl::cat(MiscOptions), cl::sub(RawSubcommand));
+ cl::cat(MiscOptions), cl::sub(DumpSubcommand));
cl::opt<bool> DumpSectionContribs("section-contribs",
cl::desc("dump section contributions"),
- cl::cat(MiscOptions), cl::sub(RawSubcommand));
+ cl::cat(MiscOptions),
+ cl::sub(DumpSubcommand));
cl::opt<bool> DumpSectionMap("section-map", cl::desc("dump section map"),
- cl::cat(MiscOptions), cl::sub(RawSubcommand));
+ cl::cat(MiscOptions), cl::sub(DumpSubcommand));
cl::opt<bool> RawAll("all", cl::desc("Implies most other options."),
- cl::cat(MiscOptions), cl::sub(RawSubcommand));
+ cl::cat(MiscOptions), cl::sub(DumpSubcommand));
cl::list<std::string> InputFilenames(cl::Positional,
cl::desc("<input PDB files>"),
- cl::OneOrMore, cl::sub(RawSubcommand));
+ cl::OneOrMore, cl::sub(DumpSubcommand));
}
namespace yaml2pdb {
std::unique_ptr<IPDBSession> Session;
auto &File = loadPDB(Path, Session);
- auto O = llvm::make_unique<RawOutputStyle>(File);
+ auto O = llvm::make_unique<DumpOutputStyle>(File);
ExitOnErr(O->dump());
}
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
cl::ParseCommandLineOptions(argv.size(), argv.data(), "LLVM PDB Dumper\n");
- if (!opts::raw::DumpBlockRangeOpt.empty()) {
+ if (!opts::dump::DumpBlockRangeOpt.empty()) {
llvm::Regex R("^([0-9]+)(-([0-9]+))?$");
llvm::SmallVector<llvm::StringRef, 2> Matches;
- if (!R.match(opts::raw::DumpBlockRangeOpt, &Matches)) {
- errs() << "Argument '" << opts::raw::DumpBlockRangeOpt
+ if (!R.match(opts::dump::DumpBlockRangeOpt, &Matches)) {
+ errs() << "Argument '" << opts::dump::DumpBlockRangeOpt
<< "' invalid format.\n";
errs().flush();
exit(1);
}
- opts::raw::DumpBlockRange.emplace();
- Matches[1].getAsInteger(10, opts::raw::DumpBlockRange->Min);
+ opts::dump::DumpBlockRange.emplace();
+ Matches[1].getAsInteger(10, opts::dump::DumpBlockRange->Min);
if (!Matches[3].empty()) {
- opts::raw::DumpBlockRange->Max.emplace();
- Matches[3].getAsInteger(10, *opts::raw::DumpBlockRange->Max);
+ opts::dump::DumpBlockRange->Max.emplace();
+ Matches[3].getAsInteger(10, *opts::dump::DumpBlockRange->Max);
}
}
- if (opts::RawSubcommand) {
- if (opts::raw::RawAll) {
- opts::raw::DumpLines = true;
- opts::raw::DumpInlineeLines = true;
- opts::raw::DumpXme = true;
- opts::raw::DumpXmi = true;
- opts::raw::DumpIds = true;
- opts::raw::DumpPublics = true;
- opts::raw::DumpSectionContribs = true;
- opts::raw::DumpSectionMap = true;
- opts::raw::DumpStreams = true;
- opts::raw::DumpStringTable = true;
- opts::raw::DumpSummary = true;
- opts::raw::DumpSymbols = true;
- opts::raw::DumpIds = true;
- opts::raw::DumpIdExtras = true;
- opts::raw::DumpTypes = true;
- opts::raw::DumpTypeExtras = true;
- opts::raw::DumpModules = true;
- opts::raw::DumpModuleFiles = true;
+ if (opts::DumpSubcommand) {
+ if (opts::dump::RawAll) {
+ opts::dump::DumpLines = true;
+ opts::dump::DumpInlineeLines = true;
+ opts::dump::DumpXme = true;
+ opts::dump::DumpXmi = true;
+ opts::dump::DumpIds = true;
+ opts::dump::DumpPublics = true;
+ opts::dump::DumpSectionContribs = true;
+ opts::dump::DumpSectionMap = true;
+ opts::dump::DumpStreams = true;
+ opts::dump::DumpStringTable = true;
+ opts::dump::DumpSummary = true;
+ opts::dump::DumpSymbols = true;
+ opts::dump::DumpIds = true;
+ opts::dump::DumpIdExtras = true;
+ opts::dump::DumpTypes = true;
+ opts::dump::DumpTypeExtras = true;
+ opts::dump::DumpModules = true;
+ opts::dump::DumpModuleFiles = true;
}
}
if (opts::PdbToYamlSubcommand) {
}
std::for_each(opts::pretty::InputFilenames.begin(),
opts::pretty::InputFilenames.end(), dumpPretty);
- } else if (opts::RawSubcommand) {
- std::for_each(opts::raw::InputFilenames.begin(),
- opts::raw::InputFilenames.end(), dumpRaw);
+ } else if (opts::DumpSubcommand) {
+ std::for_each(opts::dump::InputFilenames.begin(),
+ opts::dump::InputFilenames.end(), dumpRaw);
} else if (opts::DiffSubcommand) {
if (opts::diff::InputFilenames.size() != 2) {
errs() << "diff subcommand expects exactly 2 arguments.\n";
extern llvm::cl::opt<uint32_t> ClassRecursionDepth;
}
-namespace raw {
+namespace dump {
struct BlockRange {
uint32_t Min;
llvm::Optional<uint32_t> Max;