summaryrefslogtreecommitdiff
path: root/tools/llvm-pdbutil/llvm-pdbutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-pdbutil/llvm-pdbutil.cpp')
-rw-r--r--tools/llvm-pdbutil/llvm-pdbutil.cpp44
1 files changed, 34 insertions, 10 deletions
diff --git a/tools/llvm-pdbutil/llvm-pdbutil.cpp b/tools/llvm-pdbutil/llvm-pdbutil.cpp
index ad11ad498000..6aa08ff3cd87 100644
--- a/tools/llvm-pdbutil/llvm-pdbutil.cpp
+++ b/tools/llvm-pdbutil/llvm-pdbutil.cpp
@@ -284,9 +284,32 @@ cl::opt<bool> NoEnumDefs("no-enum-definitions",
}
namespace diff {
-cl::list<std::string> InputFilenames(cl::Positional,
- cl::desc("<first> <second>"),
- cl::OneOrMore, cl::sub(DiffSubcommand));
+cl::opt<bool> PrintValueColumns(
+ "values", cl::init(true),
+ cl::desc("Print one column for each PDB with the field value"),
+ cl::Optional, cl::sub(DiffSubcommand));
+cl::opt<bool>
+ PrintResultColumn("result", cl::init(false),
+ cl::desc("Print a column with the result status"),
+ cl::Optional, cl::sub(DiffSubcommand));
+
+cl::opt<std::string> LeftRoot(
+ "left-bin-root", cl::Optional,
+ cl::desc("Treats the specified path as the root of the tree containing "
+ "binaries referenced by the left PDB. The root is stripped from "
+ "embedded paths when doing equality comparisons."),
+ cl::sub(DiffSubcommand));
+cl::opt<std::string> RightRoot(
+ "right-bin-root", cl::Optional,
+ cl::desc("Treats the specified path as the root of the tree containing "
+ "binaries referenced by the right PDB. The root is stripped from "
+ "embedded paths when doing equality comparisons"),
+ cl::sub(DiffSubcommand));
+
+cl::opt<std::string> Left(cl::Positional, cl::desc("<left>"),
+ cl::sub(DiffSubcommand));
+cl::opt<std::string> Right(cl::Positional, cl::desc("<right>"),
+ cl::sub(DiffSubcommand));
}
cl::OptionCategory FileOptions("Module & File Options");
@@ -399,7 +422,7 @@ cl::opt<bool> DumpTypeExtras("type-extras",
cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::list<uint32_t> DumpTypeIndex(
- "type-index", cl::ZeroOrMore,
+ "type-index", cl::ZeroOrMore, cl::CommaSeparated,
cl::desc("only dump types with the specified hexadecimal type index"),
cl::cat(TypeOptions), cl::sub(DumpSubcommand));
@@ -415,7 +438,7 @@ cl::opt<bool> DumpIdExtras("id-extras",
cl::desc("dump id hashes and index offsets"),
cl::cat(TypeOptions), cl::sub(DumpSubcommand));
cl::list<uint32_t> DumpIdIndex(
- "id-index", cl::ZeroOrMore,
+ "id-index", cl::ZeroOrMore, cl::CommaSeparated,
cl::desc("only dump ids with the specified hexadecimal type index"),
cl::cat(TypeOptions), cl::sub(DumpSubcommand));
@@ -1079,6 +1102,11 @@ int main(int argc_, const char *argv_[]) {
if (opts::pdb2yaml::DumpModules)
opts::pdb2yaml::DbiStream = true;
}
+ if (opts::DiffSubcommand) {
+ if (!opts::diff::PrintResultColumn && !opts::diff::PrintValueColumns) {
+ llvm::errs() << "WARNING: No diff columns specified\n";
+ }
+ }
llvm::sys::InitializeCOMRAII COM(llvm::sys::COMThreadingMode::MultiThreaded);
@@ -1137,11 +1165,7 @@ int main(int argc_, const char *argv_[]) {
std::for_each(opts::bytes::InputFilenames.begin(),
opts::bytes::InputFilenames.end(), dumpBytes);
} else if (opts::DiffSubcommand) {
- if (opts::diff::InputFilenames.size() != 2) {
- errs() << "diff subcommand expects exactly 2 arguments.\n";
- exit(1);
- }
- diff(opts::diff::InputFilenames[0], opts::diff::InputFilenames[1]);
+ diff(opts::diff::Left, opts::diff::Right);
} else if (opts::MergeSubcommand) {
if (opts::merge::InputFilenames.size() < 2) {
errs() << "merge subcommand requires at least 2 input files.\n";