1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[llvm-pdbutil] Rename "raw" to "dump".

Now you run llvm-pdbutil dump <options>.  This is a followup
after having renamed the tool, whereas before raw was obviously
just the style of dumping, whereas now "dump" is the action to
perform with the "util".

llvm-svn: 306055
This commit is contained in:
Zachary Turner 2017-06-22 20:57:39 +00:00
parent cc029738a1
commit 6ee4ce7f1d
11 changed files with 135 additions and 134 deletions

View File

@ -1,8 +1,8 @@
; 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: ============================================================

View File

@ -1,8 +1,8 @@
; 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)

View File

@ -1,7 +1,7 @@
+; 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)

View File

@ -1,8 +1,8 @@
; 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: ============================================================

View File

@ -1,6 +1,6 @@
; 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: ============================================================

View File

@ -3,8 +3,8 @@ RUN: -pdb-stream -string-table -tpi-stream -stream-directory \
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

View File

@ -10,6 +10,7 @@ set(LLVM_LINK_COMPONENTS
add_llvm_tool(llvm-pdbutil
Analyze.cpp
Diff.cpp
DumpOutputStyle.cpp
llvm-pdbutil.cpp
FormatUtil.cpp
LinePrinter.cpp
@ -26,7 +27,6 @@ add_llvm_tool(llvm-pdbutil
PrettyTypeDumper.cpp
PrettyTypedefDumper.cpp
PrettyVariableDumper.cpp
RawOutputStyle.cpp
StreamUtil.cpp
YAMLOutputStyle.cpp
)

View File

@ -1,4 +1,4 @@
//===- RawOutputStyle.cpp ------------------------------------ *- C++ --*-===//
//===- DumpOutputStyle.cpp ------------------------------------ *- C++ --*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
#include "RawOutputStyle.h"
#include "DumpOutputStyle.h"
#include "FormatUtil.h"
#include "MinimalSymbolDumper.h"
@ -64,96 +64,96 @@ using namespace llvm::codeview;
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;
}
@ -167,7 +167,7 @@ static void printHeader(LinePrinter &P, const Twine &S) {
P.formatLine("{0}", fmt_repeat('=', 60));
}
Error RawOutputStyle::dumpFileSummary() {
Error DumpOutputStyle::dumpFileSummary() {
printHeader(P, "Summary");
ExitOnError Err("Invalid PDB Format");
@ -197,7 +197,7 @@ Error RawOutputStyle::dumpFileSummary() {
return Error::success();
}
Error RawOutputStyle::dumpStreamSummary() {
Error DumpOutputStyle::dumpStreamSummary() {
printHeader(P, "Streams");
if (StreamPurposes.empty())
@ -216,10 +216,10 @@ Error RawOutputStyle::dumpStreamSummary() {
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);
@ -264,14 +264,14 @@ static Error parseStreamSpec(StringRef Str, uint32_t &SI, uint32_t &Offset,
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;
@ -493,7 +493,7 @@ static void iterateModuleSubsections(
});
}
Error RawOutputStyle::dumpModules() {
Error DumpOutputStyle::dumpModules() {
printHeader(P, "Modules");
AutoIndent Indent(P);
@ -521,7 +521,7 @@ Error RawOutputStyle::dumpModules() {
return Error::success();
}
Error RawOutputStyle::dumpModuleFiles() {
Error DumpOutputStyle::dumpModuleFiles() {
printHeader(P, "Files");
ExitOnError Err("Unexpected error processing modules");
@ -573,7 +573,7 @@ static void typesetLinesAndColumns(PDBFile &File, LinePrinter &P,
}
}
Error RawOutputStyle::dumpLines() {
Error DumpOutputStyle::dumpLines() {
printHeader(P, "Lines");
uint32_t LastModi = UINT32_MAX;
@ -609,7 +609,7 @@ Error RawOutputStyle::dumpLines() {
return Error::success();
}
Error RawOutputStyle::dumpInlineeLines() {
Error DumpOutputStyle::dumpInlineeLines() {
printHeader(P, "Inlinee Lines");
iterateModuleSubsections<DebugInlineeLinesSubsectionRef>(
@ -628,7 +628,7 @@ Error RawOutputStyle::dumpInlineeLines() {
return Error::success();
}
Error RawOutputStyle::dumpXmi() {
Error DumpOutputStyle::dumpXmi() {
printHeader(P, "Cross Module Imports");
iterateModuleSubsections<DebugCrossModuleImportsSubsectionRef>(
File, P, 2,
@ -663,7 +663,7 @@ Error RawOutputStyle::dumpXmi() {
return Error::success();
}
Error RawOutputStyle::dumpXme() {
Error DumpOutputStyle::dumpXme() {
printHeader(P, "Cross Module Exports");
iterateModuleSubsections<DebugCrossModuleExportsSubsectionRef>(
@ -680,7 +680,7 @@ Error RawOutputStyle::dumpXme() {
return Error::success();
}
Error RawOutputStyle::dumpStringTable() {
Error DumpOutputStyle::dumpStringTable() {
printHeader(P, "String Table");
AutoIndent Indent(P);
@ -722,7 +722,7 @@ Error RawOutputStyle::dumpStringTable() {
return Error::success();
}
Error RawOutputStyle::dumpTpiStream(uint32_t StreamIdx) {
Error DumpOutputStyle::dumpTpiStream(uint32_t StreamIdx) {
assert(StreamIdx == StreamTPI || StreamIdx == StreamIPI);
bool Present = false;
@ -733,19 +733,19 @@ Error RawOutputStyle::dumpTpiStream(uint32_t StreamIdx) {
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);
@ -814,7 +814,7 @@ Error RawOutputStyle::dumpTpiStream(uint32_t StreamIdx) {
}
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();
@ -832,7 +832,7 @@ RawOutputStyle::initializeTypes(uint32_t SN) {
return *TypeCollection;
}
Error RawOutputStyle::dumpModuleSyms() {
Error DumpOutputStyle::dumpModuleSyms() {
printHeader(P, "Symbols");
AutoIndent Indent(P);
@ -872,7 +872,7 @@ Error RawOutputStyle::dumpModuleSyms() {
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);
@ -886,7 +886,7 @@ Error RawOutputStyle::dumpModuleSyms() {
return Error::success();
}
Error RawOutputStyle::dumpPublics() {
Error DumpOutputStyle::dumpPublics() {
printHeader(P, "Public Symbols");
AutoIndent Indent(P);
@ -901,7 +901,7 @@ Error RawOutputStyle::dumpPublics() {
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);
@ -1001,7 +1001,7 @@ static std::string formatSegMapDescriptorFlag(uint32_t IndentLevel,
return typesetItemList(Opts, IndentLevel, 4, " | ");
}
Error RawOutputStyle::dumpSectionContribs() {
Error DumpOutputStyle::dumpSectionContribs() {
printHeader(P, "Section Contributions");
ExitOnError Err("Error dumping publics stream");
@ -1047,7 +1047,7 @@ Error RawOutputStyle::dumpSectionContribs() {
return Error::success();
}
Error RawOutputStyle::dumpSectionMap() {
Error DumpOutputStyle::dumpSectionMap() {
printHeader(P, "Section Map");
ExitOnError Err("Error dumping section map");

View File

@ -1,4 +1,4 @@
//===- RawOutputStyle.h -------------------------------------- *- C++ --*-===//
//===- DumpOutputStyle.h -------------------------------------- *- C++ --*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
#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"
@ -26,9 +26,9 @@ class LazyRandomTypeCollection;
}
namespace pdb {
class RawOutputStyle : public OutputStyle {
class DumpOutputStyle : public OutputStyle {
public:
RawOutputStyle(PDBFile &File);
DumpOutputStyle(PDBFile &File);
Error dump() override;

View File

@ -15,6 +15,7 @@
#include "Analyze.h"
#include "Diff.h"
#include "DumpOutputStyle.h"
#include "LinePrinter.h"
#include "OutputStyle.h"
#include "PrettyCompilandDumper.h"
@ -22,7 +23,6 @@
#include "PrettyFunctionDumper.h"
#include "PrettyTypeDumper.h"
#include "PrettyVariableDumper.h"
#include "RawOutputStyle.h"
#include "YAMLOutputStyle.h"
#include "llvm/ADT/ArrayRef.h"
@ -86,7 +86,7 @@ using namespace llvm::pdb;
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");
@ -263,7 +263,7 @@ cl::list<std::string> InputFilenames(cl::Positional,
cl::OptionCategory FileOptions("Module & File Options");
namespace raw {
namespace dump {
cl::OptionCategory MsfOptions("MSF Container Options");
cl::OptionCategory TypeOptions("Type Record Options");
@ -272,109 +272,110 @@ cl::OptionCategory MiscOptions("Miscellaneous 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 {
@ -620,7 +621,7 @@ static void dumpRaw(StringRef Path) {
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());
}
@ -896,43 +897,43 @@ int main(int argc_, const char *argv_[]) {
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) {
@ -1014,9 +1015,9 @@ int main(int argc_, const char *argv_[]) {
}
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";

View File

@ -92,7 +92,7 @@ extern llvm::cl::opt<ClassDefinitionFormat> ClassFormat;
extern llvm::cl::opt<uint32_t> ClassRecursionDepth;
}
namespace raw {
namespace dump {
struct BlockRange {
uint32_t Min;
llvm::Optional<uint32_t> Max;