aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
diff options
context:
space:
mode:
authorgbreynoo <Owen.Reynolds@sony.com>2021-05-07 11:21:51 +0100
committergbreynoo <Owen.Reynolds@sony.com>2021-05-07 11:23:05 +0100
commitf0762fc42f0f4ecf849bef42eed2bb4c0785ea67 (patch)
tree2e99c1a3fe005267635719fd6fef3fcfa0af14b6 /llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
parente805b7c2d63c1f8b74f228718a55536f54ddd1c0 (diff)
downloadllvm-f0762fc42f0f4ecf849bef42eed2bb4c0785ea67.zip
llvm-f0762fc42f0f4ecf849bef42eed2bb4c0785ea67.tar.gz
llvm-f0762fc42f0f4ecf849bef42eed2bb4c0785ea67.tar.bz2
[llvm-dwarfdump] Help option output should be consistent with the command guide
The dwarfdump command guide shows the short options used as aliases but these are not found in the help text unless --show-hidden is used. Investigating other tools some follow this pattern, others like llvm-objdump show aliases with --help. This change fixes the help output to be consistent with the command guide. This includes updating alias descriptions in the help output to use "--". As part of this change I updated cmdline.test, including some options that were missing testing. Differential Revision: https://reviews.llvm.org/D101646
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp42
1 files changed, 24 insertions, 18 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 642e452..78665c0 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -130,7 +130,8 @@ cl::OptionCategory SectionCategory("Section-specific Dump Options",
static opt<bool> DumpAll("all", desc("Dump all debug info sections"),
cat(SectionCategory));
-static alias DumpAllAlias("a", desc("Alias for -all"), aliasopt(DumpAll));
+static alias DumpAllAlias("a", desc("Alias for --all"), aliasopt(DumpAll),
+ cl::NotHidden);
// Options for dumping specific sections.
static unsigned DumpType = DIDT_Null;
@@ -143,7 +144,7 @@ static std::array<llvm::Optional<uint64_t>, (unsigned)DIDT_ID_Count>
#include "llvm/BinaryFormat/Dwarf.def"
#undef HANDLE_DWARF_SECTION
-static alias DumpDebugFrameAlias("eh-frame", desc("Alias for -debug-frame"),
+static alias DumpDebugFrameAlias("eh-frame", desc("Alias for --debug-frame"),
NotHidden, cat(SectionCategory),
aliasopt(DumpDebugFrame));
static list<std::string>
@@ -164,19 +165,21 @@ static list<std::string>
"accelerator tables are available, the slower but more complete "
"-name option can be used instead."),
value_desc("name"), cat(DwarfDumpCategory));
-static alias FindAlias("f", desc("Alias for -find."), aliasopt(Find));
+static alias FindAlias("f", desc("Alias for --find."), aliasopt(Find),
+ cl::NotHidden);
static opt<bool> IgnoreCase("ignore-case",
desc("Ignore case distinctions when searching."),
value_desc("i"), cat(DwarfDumpCategory));
-static alias IgnoreCaseAlias("i", desc("Alias for -ignore-case."),
- aliasopt(IgnoreCase));
+static alias IgnoreCaseAlias("i", desc("Alias for --ignore-case."),
+ aliasopt(IgnoreCase), cl::NotHidden);
static list<std::string> Name(
"name",
desc("Find and print all debug info entries whose name (DW_AT_name "
"attribute) matches the exact text in <pattern>. When used with the "
"the -regex option <pattern> is interpreted as a regular expression."),
value_desc("pattern"), cat(DwarfDumpCategory));
-static alias NameAlias("n", desc("Alias for -name"), aliasopt(Name));
+static alias NameAlias("n", desc("Alias for --name"), aliasopt(Name),
+ cl::NotHidden);
static opt<uint64_t>
Lookup("lookup",
desc("Lookup <address> in the debug information and print out any "
@@ -193,34 +196,36 @@ static opt<bool>
desc("Treat any <pattern> strings as regular expressions when "
"searching instead of just as an exact string match."),
cat(DwarfDumpCategory));
-static alias RegexAlias("x", desc("Alias for -regex"), aliasopt(UseRegex));
+static alias RegexAlias("x", desc("Alias for --regex"), aliasopt(UseRegex),
+ cl::NotHidden);
static opt<bool>
ShowChildren("show-children",
desc("Show a debug info entry's children when selectively "
"printing entries."),
cat(DwarfDumpCategory));
-static alias ShowChildrenAlias("c", desc("Alias for -show-children."),
- aliasopt(ShowChildren));
+static alias ShowChildrenAlias("c", desc("Alias for --show-children."),
+ aliasopt(ShowChildren), cl::NotHidden);
static opt<bool>
ShowParents("show-parents",
desc("Show a debug info entry's parents when selectively "
"printing entries."),
cat(DwarfDumpCategory));
-static alias ShowParentsAlias("p", desc("Alias for -show-parents."),
- aliasopt(ShowParents));
+static alias ShowParentsAlias("p", desc("Alias for --show-parents."),
+ aliasopt(ShowParents), cl::NotHidden);
static opt<bool>
ShowForm("show-form",
desc("Show DWARF form types after the DWARF attribute types."),
cat(DwarfDumpCategory));
-static alias ShowFormAlias("F", desc("Alias for -show-form."),
- aliasopt(ShowForm), cat(DwarfDumpCategory));
+static alias ShowFormAlias("F", desc("Alias for --show-form."),
+ aliasopt(ShowForm), cat(DwarfDumpCategory),
+ cl::NotHidden);
static opt<unsigned>
ChildRecurseDepth("recurse-depth",
desc("Only recurse to a depth of N when displaying "
"children of debug info entries."),
cat(DwarfDumpCategory), init(-1U), value_desc("N"));
-static alias ChildRecurseDepthAlias("r", desc("Alias for -recurse-depth."),
- aliasopt(ChildRecurseDepth));
+static alias ChildRecurseDepthAlias("r", desc("Alias for --recurse-depth."),
+ aliasopt(ChildRecurseDepth), cl::NotHidden);
static opt<unsigned>
ParentRecurseDepth("parent-recurse-depth",
desc("Only recurse to a depth of N when displaying "
@@ -245,12 +250,13 @@ 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."),
cat(DwarfDumpCategory));
-static alias DumpUUIDAlias("u", desc("Alias for -uuid."), aliasopt(DumpUUID));
+static alias DumpUUIDAlias("u", desc("Alias for --uuid."), aliasopt(DumpUUID),
+ cl::NotHidden);
static opt<bool> Verbose("verbose",
desc("Print more low-level encoding details."),
cat(DwarfDumpCategory));
-static alias VerboseAlias("v", desc("Alias for -verbose."), aliasopt(Verbose),
- cat(DwarfDumpCategory));
+static alias VerboseAlias("v", desc("Alias for --verbose."), aliasopt(Verbose),
+ cat(DwarfDumpCategory), cl::NotHidden);
static cl::extrahelp
HelpResponse("\nPass @FILE as argument to read options from FILE.\n");
} // namespace