This is an initial take on a man page for llvm-objdump based on usage output and LLVM's doc.
Details
Diff Detail
Event Timeline
lgtm, but seems that some hidden/alias options are not listed here (I could help add them). I am not expert in this area, so I will leave the decision to @kristina
BTW, usr.bin/clang/llvm-objdump/llvm-objdump.1 here is not FreeBSD phabricator :) (My biggest complaint there is that for someone who doesn't have a @FreeBSD.org email address, the username is weirdly mangled from the email address and it cannot be changed)
usr.bin/clang/llvm-objdump/llvm-objdump.1 | ||
---|---|---|
12 ↗ | (On Diff #175132) | It does not seem very necessary to list all options in SYNOPSIS. |
218 ↗ | (On Diff #175132) | -print-after-all is a legacy PM option defined in lib/IR/LegacyPassManager.cpp. llvm-objdump doesn't need it. These cl::opt options should at some point be refactored to use tablegen as llvm-objcopy does... |
238 ↗ | (On Diff #175132) | It should be accompanied by -full-sections. My preference is that these options are sorted and aligned by their full names and the single-letter aliases follow (not following GNU convention), as what lld/docs/ld.lld1.1 does: .It Fl -emit-relocs , Fl q Generate relocations in the output. .It Fl -enable-new-dtags Enable new dynamic tags. |
I just based this on the usage output. I will update with added/removed options and we can iterate on it from there.
Sorry about that :)
Next upload will be from the proper llvm location - since the content is the same I just uploaded the same diff here.
usr.bin/clang/llvm-objdump/llvm-objdump.1 | ||
---|---|---|
12 ↗ | (On Diff #175132) | Same comment was raised in a separate review for FreeBSD in https://reviews.freebsd.org/D18309. Will update. |
69 ↗ | (On Diff #175132) | Will delete. |
70 ↗ | (On Diff #175132) | Will delete. |
218 ↗ | (On Diff #175132) | Will delete. |
238 ↗ | (On Diff #175132) | It was pointed out in some ld.lld.1 review that preference should be for sorting by short option, but I believe that some of the short options are still not listed in ld.lld.1. |
Everything that is explicitly marked as non-hidden should be in the man-page.
These cl::opt options should at some point be refactored to use tablegen as llvm-objcopy does...
Yes that's on my todo list still, been trying to deal with an annoying Clang bug as well as reviewing the Hurd driver for Clang and Hurd's addition to supported OS targets. I wrote up the TableGen file, but still need to fix a lot of help lines as well as clean everything up.
I'll try to get on it ASAP.
Additional comment that wasn't submitted while reviews.llvm.org was down on Friday: I started working on this as it's needed for us to switch from GNU objdump to llvm-objdump in FreeBSD (FreeBSD PR229046).
As an aside, there are a few outstanding issues in llvm-objdump that we'd like to have addressed (LLVM PRs):
39101 llvm-objdump does not support --demangle
37895 llvm-objdump --help omits many single-letter options
37151 llvm-objdump does not accept -z option
31679 llvm-objdump does not accept combined args as GNU objdump does
30241 llvm-objdump -p omits dynamic headers (in comparison to GNU objdump)
27249 llvm-objdump --dwarf=frames printing wrong values
26892 llvm-objdump -t includes reserved undefined symbol in output, compared with GNU objdump
25124 llvm-objdump prints unknown for relocation info on PPC
21059 llvm-objdump -r reports relocation against symbol `Unknown' on x86
18293 llvm-objdump: warning: invalid instruction encoding
18154 llvm-objdump should have a option to start disassembly at a specified symbol name
It seems that there are option parsing improvements to be made in llvm-objdump, as well as in its usage information. I hope that we can commit this man page and then keep it updates as that work is done.
I have an interim copy in FreeBSD and am updating it based on the feedback here; I'll update this review shortly.
The FreeBSD version is here: https://svnweb.freebsd.org/base/head/usr.bin/clang/llvm-objdump/llvm-objdump.1?view=annotate
- fix warnings from mandoc -Tlint and/or igor
- remove options that should not be listed
-rng-seed is in lib/Support/RandomNumberGenerator.cpp