aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 941df4e..559e7a6 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -124,6 +124,14 @@ public:
namespace {
using namespace cl;
+enum ErrorDetailLevel {
+ OnlyDetailsNoSummary,
+ NoDetailsOnlySummary,
+ NoDetailsOrSummary,
+ BothDetailsAndSummary,
+ Unspecified
+};
+
OptionCategory DwarfDumpCategory("Specific Options");
static list<std::string>
InputFilenames(Positional, desc("<input object files or .dSYM bundles>"),
@@ -276,6 +284,17 @@ static cl::opt<bool>
cat(DwarfDumpCategory));
static opt<bool> Verify("verify", desc("Verify the DWARF debug info."),
cat(DwarfDumpCategory));
+static opt<ErrorDetailLevel> ErrorDetails(
+ "error-display", init(Unspecified),
+ values(clEnumValN(NoDetailsOrSummary, "quiet",
+ "Only display whether errors occurred."),
+ clEnumValN(NoDetailsOnlySummary, "summary",
+ "Display only a summary of the errors found."),
+ clEnumValN(OnlyDetailsNoSummary, "details",
+ "Display each error in detail but no summary."),
+ clEnumValN(BothDetailsAndSummary, "full",
+ "Display each error as well as a summary. [default]")),
+ cat(DwarfDumpCategory));
static opt<bool> Quiet("quiet", desc("Use with -verify to not emit to STDOUT."),
cat(DwarfDumpCategory));
static opt<bool> DumpUUID("uuid", desc("Show the UUID for each architecture."),
@@ -326,7 +345,10 @@ static DIDumpOptions getDumpOpts(DWARFContext &C) {
DumpOpts.RecoverableErrorHandler = C.getRecoverableErrorHandler();
// In -verify mode, print DIEs without children in error messages.
if (Verify) {
- DumpOpts.Verbose = true;
+ DumpOpts.Verbose = ErrorDetails != NoDetailsOnlySummary &&
+ ErrorDetails != NoDetailsOrSummary;
+ DumpOpts.ShowAggregateErrors = ErrorDetails != OnlyDetailsNoSummary &&
+ ErrorDetails != NoDetailsOnlySummary;
return DumpOpts.noImplicitRecursion();
}
return DumpOpts;
@@ -812,6 +834,8 @@ int main(int argc, char **argv) {
"-verbose is currently not supported";
return 1;
}
+ if (!Verify && ErrorDetails != Unspecified)
+ WithColor::warning() << "-error-detail has no affect without -verify";
std::error_code EC;
ToolOutputFile OutputFile(OutputFilename, EC, sys::fs::OF_TextWithCRLF);