From b7924d6525be103b6ffd93c7b9787d4339b3ad61 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 18 May 2020 11:34:09 -0700 Subject: [PATCH] [dsymutil] Make sure the --help output and man page are consistent As suggested by Adrian in D79398. --- llvm/docs/CommandGuide/dsymutil.rst | 34 +++++++++++----------- llvm/test/tools/dsymutil/cmdline.test | 54 +++++++++++++++++++---------------- llvm/tools/dsymutil/Options.td | 3 +- 3 files changed, 48 insertions(+), 43 deletions(-) diff --git a/llvm/docs/CommandGuide/dsymutil.rst b/llvm/docs/CommandGuide/dsymutil.rst index 5e0140b..5b7016c 100644 --- a/llvm/docs/CommandGuide/dsymutil.rst +++ b/llvm/docs/CommandGuide/dsymutil.rst @@ -23,7 +23,7 @@ OPTIONS Specify the desired type of accelerator table. Valid options are 'Apple', 'Dwarf' and 'Default'. -.. option:: --arch= +.. option:: --arch Link DWARF debug information only for specified CPU architecture types. Architectures may be specified by name. When using this option, an error will @@ -37,19 +37,22 @@ OPTIONS Dump the *executable*'s debug-map (the list of the object files containing the debug information) in YAML format and exit. Not DWARF link will take place. -.. option:: -f, --flat +.. option:: --flat, -f Produce a flat dSYM file. A ``.dwarf`` extension will be appended to the executable name unless the output file is specified using the ``-o`` option. -.. option:: -h, --help +.. option:: --help, -h Print this help output. -.. option:: -j , --num-threads= +.. option:: --minimize, -z - Specifies the maximum number (``n``) of simultaneous threads to use when - linking multiple architectures. + When used when creating a dSYM file, this option will suppress the emission of + the .debug_inlines, .debug_pubnames, and .debug_pubtypes sections since + dsymutil currently has better equivalents: .apple_names and .apple_types. When + used in conjunction with ``--update`` option, this option will cause redundant + accelerator tables to be removed. .. option:: --no-odr @@ -63,17 +66,22 @@ OPTIONS Don't check the timestamp for swiftmodule files. -.. option:: --object-prefix-map= +.. option:: --num-threads , -j + + Specifies the maximum number (``n``) of simultaneous threads to use when + linking multiple architectures. + +.. option:: --object-prefix-map Remap object file paths (but no source paths) before processing. Use this for Clang objects where the module cache location was remapped using ``-fdebug-prefix-map``; to help dsymutil find the Clang module cache. -.. option:: --oso-prepend-path= +.. option:: --oso-prepend-path Specifies a ``path`` to prepend to all debug symbol object file paths. -.. option:: -o , --out +.. option:: --out , -o Specifies an alternate ``path`` to place the dSYM bundle. The default dSYM bundle path is created by appending ``.dSYM`` to the executable name. @@ -139,14 +147,6 @@ OPTIONS Treat *executable* as a YAML debug-map rather than an executable. -.. option:: -z, --minimize - - When used when creating a dSYM file, this option will suppress the emission of - the .debug_inlines, .debug_pubnames, and .debug_pubtypes sections since - dsymutil currently has better equivalents: .apple_names and .apple_types. When - used in conjunction with ``--update`` option, this option will cause redundant - accelerator tables to be removed. - EXIT STATUS ----------- diff --git a/llvm/test/tools/dsymutil/cmdline.test b/llvm/test/tools/dsymutil/cmdline.test index c1347ea..29f6e70 100644 --- a/llvm/test/tools/dsymutil/cmdline.test +++ b/llvm/test/tools/dsymutil/cmdline.test @@ -1,32 +1,36 @@ -RUN: dsymutil -help 2>&1 | FileCheck --check-prefix=HELP %s +RUN: dsymutil -help 2>&1 | FileCheck --check-prefix=CHECK --check-prefix=HELP %s +RUN: cat %S/../../../docs/CommandGuide/dsymutil.rst | FileCheck %s + HELP: OVERVIEW: manipulate archived DWARF debug symbol files. HELP: USAGE: {{.*}}dsymutil{{[^ ]*}} [options] HELP-NOT: -reverse-iterate HELP: Dsymutil Options: -HELP: -accelerator -HELP: -arch -HELP: -dump-debug-map -HELP: -flat -HELP: -minimize -HELP: -no-odr -HELP: -no-output -HELP: -no-swiftmodule-timestamp -HELP: -num-threads -HELP: -object-prefix-map -HELP: -oso-prepend-path -HELP: {{ -o }} -HELP: -papertrail -HELP: -remarks-output-format -HELP: -remarks-prepend-path -HELP: -statistics -HELP: -symbol-map -HELP: -symtab -HELP: {{ -S }} -HELP: -toolchain -HELP: -update -HELP: -verbose -HELP: -verify -HELP: {{ -y }} +CHECK: -accelerator +CHECK: -arch +CHECK: -dump-debug-map +CHECK: -flat +CHECK: -help +CHECK: -minimize +CHECK: -no-odr +CHECK: -no-output +CHECK: -no-swiftmodule-timestamp +CHECK: -num-threads +CHECK: -object-prefix-map +CHECK: -oso-prepend-path +CHECK: -out +CHECK: {{-o }} +CHECK: -papertrail +CHECK: -remarks-output-format +CHECK: -remarks-prepend-path +CHECK: -statistics +CHECK: -symbol-map +CHECK: -symtab +CHECK: {{-S}} +CHECK: -toolchain +CHECK: -update +CHECK: -verbose +CHECK: -verify +CHECK: {{-y}} HELP-NOT: -reverse-iterate RUN: dsymutil --version 2>&1 | FileCheck --check-prefix=VERSION %s diff --git a/llvm/tools/dsymutil/Options.td b/llvm/tools/dsymutil/Options.td index 1542a94..bdd11b5 100644 --- a/llvm/tools/dsymutil/Options.td +++ b/llvm/tools/dsymutil/Options.td @@ -107,6 +107,7 @@ def output: Separate<["-", "--"], "o">, HelpText<"Specify the output file. Defaults to .dwarf">, Group; def: Separate<["--", "-"], "out">, + MetaVarName<"">, Alias, HelpText<"Alias for -o">, Group; @@ -159,7 +160,7 @@ def threads: Separate<["--", "-"], "num-threads">, HelpText<"Specifies the maximum number of simultaneous threads to use when linking multiple architectures.">, Group; def: Separate<["-"], "j">, - Alias, + MetaVarName<"">, HelpText<"Alias for --num-threads">, Group; -- 2.7.4