[llvm-dwarfdump][docs] Add missing options to the help output and the command guide
authorgbreynoo <Owen.Reynolds@sony.com>
Mon, 27 Sep 2021 13:28:31 +0000 (14:28 +0100)
committergbreynoo <Owen.Reynolds@sony.com>
Mon, 27 Sep 2021 13:28:31 +0000 (14:28 +0100)
This change is to add some missing details to the help text and command
guide:

- Added a note to the command guide that --debug-macro also dumps
  .debug_macinfo.
- Added a note to the command guide that --debug-frame and --eh_frame
  are aliases, and in cases where both sections are present one command
  outputs both.
- Changed the wording in the help output for --ignore-case and --regex to
  closer match the command guide.

llvm/docs/CommandGuide/llvm-dwarfdump.rst
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp

index d0c7be44213655dc45ebc83debe986fc92818339..d0c436f08e2ba356e99c6cffa20077bc503dc42b 100644 (file)
@@ -149,7 +149,7 @@ OPTIONS
 
             Display the version of the tool.
 
-.. option:: --debug-abbrev, --debug-addr, --debug-aranges, --debug-cu-index, --debug-frame[=<offset>], --debug-gnu-pubnames, --debug-gnu-pubtypes, --debug-info [=<offset>], --debug-line [=<offset>], --debug-line-str, --debug-loc [=<offset>], --debug-loclists [=<offset>], --debug-macro, --debug-names, --debug-pubnames, --debug-pubtypes, --debug-ranges, --debug-rnglists, --debug-str, --debug-str-offsets, --debug-tu-index, --debug-types [=<offset>], --eh-frame [=<offset>], --gdb-index, --apple-names, --apple-types, --apple-namespaces, --apple-objc
+.. option:: --debug-abbrev, --debug-addr, --debug-aranges, --debug-cu-index, --debug-frame [=<offset>], --debug-gnu-pubnames, --debug-gnu-pubtypes, --debug-info [=<offset>], --debug-line [=<offset>], --debug-line-str, --debug-loc [=<offset>], --debug-loclists [=<offset>], --debug-macro, --debug-names, --debug-pubnames, --debug-pubtypes, --debug-ranges, --debug-rnglists, --debug-str, --debug-str-offsets, --debug-tu-index, --debug-types [=<offset>], --eh-frame [=<offset>], --gdb-index, --apple-names, --apple-types, --apple-namespaces, --apple-objc
 
             Dump the specified DWARF section by name. Only the
             `.debug_info` section is shown by default. Some entries
@@ -159,6 +159,10 @@ OPTIONS
             entry at that offset will be dumped, else the entire
             section will be dumped.
 
+            The :option:`--debug-macro` option prints both the .debug_macro and the .debug_macinfo sections.
+
+            The :option:`--debug-frame` and :option:`--eh-frame` options are aliases, in cases where both sections are present one command outputs both.
+
 .. option:: @<FILE>
 
             Read command-line options from `<FILE>`.
@@ -168,7 +172,7 @@ OPTIONS
 FORMAT OF STATISTICS OUTPUT
 ---------------------------
 
-The ::option:`--statistics` option generates single-line JSON output
+The :option:`--statistics` option generates single-line JSON output
 representing quality metrics of the processed debug info. These metrics are
 useful to compare changes between two compilers, particularly for judging
 the effect that a change to the compiler has on the debug info quality.
index 54bfde0109b410f4c109854f91551960a16f9543..9eeaddf14928944a1b47c270b014bdcb1d95b0e6 100644 (file)
@@ -169,7 +169,7 @@ static list<std::string>
 static alias FindAlias("f", desc("Alias for --find."), aliasopt(Find),
                        cl::NotHidden);
 static opt<bool> IgnoreCase("ignore-case",
-                            desc("Ignore case distinctions when searching."),
+                            desc("Ignore case distinctions when using --name."),
                             value_desc("i"), cat(DwarfDumpCategory));
 static alias IgnoreCaseAlias("i", desc("Alias for --ignore-case."),
                              aliasopt(IgnoreCase), cl::NotHidden);
@@ -192,11 +192,12 @@ static opt<std::string>
                    cl::value_desc("filename"), cat(DwarfDumpCategory));
 static alias OutputFilenameAlias("out-file", desc("Alias for -o."),
                                  aliasopt(OutputFilename));
-static opt<bool>
-    UseRegex("regex",
-             desc("Treat any <pattern> strings as regular expressions when "
-                  "searching instead of just as an exact string match."),
-             cat(DwarfDumpCategory));
+static opt<bool> UseRegex(
+    "regex",
+    desc("Treat any <pattern> strings as regular "
+         "expressions when searching with --name. If --ignore-case is also "
+         "specified, the regular expression becomes case-insensitive."),
+    cat(DwarfDumpCategory));
 static alias RegexAlias("x", desc("Alias for --regex"), aliasopt(UseRegex),
                         cl::NotHidden);
 static opt<bool>