[PATCH] D110417: [llvm-dwarfdump][docs] Add missing options to the help output and the command guide

Owen Reynolds via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 24 07:04:07 PDT 2021


gbreynoo created this revision.
gbreynoo added reviewers: MaskRay, Higuoxing, dblaikie, djtodoro.
Herald added a reviewer: jhenderson.
Herald added a subscriber: cmtice.
gbreynoo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110417

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


Index: llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
===================================================================
--- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -169,7 +169,7 @@
 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 @@
                    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>
Index: llvm/docs/CommandGuide/llvm-dwarfdump.rst
===================================================================
--- llvm/docs/CommandGuide/llvm-dwarfdump.rst
+++ llvm/docs/CommandGuide/llvm-dwarfdump.rst
@@ -149,7 +149,7 @@
 
             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
@@ -158,6 +158,8 @@
             respective section. When an offset is provided, only the
             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>
 
@@ -168,7 +170,7 @@
 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110417.374833.patch
Type: text/x-patch
Size: 4079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210924/9a9f53f8/attachment.bin>


More information about the llvm-commits mailing list