[PATCH] D60816: [llvm-symbolizer] Unhide and document the '-output-style' option
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 17 05:02:36 PDT 2019
ikudrin updated this revision to Diff 195542.
ikudrin retitled this revision from "[llvm-symbolizer] Unhide and document the '-output-style' option." to "[llvm-symbolizer] Unhide and document the '-output-style' option".
ikudrin added a comment.
- Extended an example for the `--output-style` option.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60816/new/
https://reviews.llvm.org/D60816
Files:
docs/CommandGuide/llvm-symbolizer.rst
tools/llvm-symbolizer/llvm-symbolizer.cpp
Index: tools/llvm-symbolizer/llvm-symbolizer.cpp
===================================================================
--- tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -148,7 +148,7 @@
static cl::opt<DIPrinter::OutputStyle>
ClOutputStyle("output-style", cl::init(DIPrinter::OutputStyle::LLVM),
- cl::desc("Specify print style"), cl::Hidden,
+ cl::desc("Specify print style"),
cl::values(clEnumValN(DIPrinter::OutputStyle::LLVM, "LLVM",
"LLVM default style"),
clEnumValN(DIPrinter::OutputStyle::GNU, "GNU",
Index: docs/CommandGuide/llvm-symbolizer.rst
===================================================================
--- docs/CommandGuide/llvm-symbolizer.rst
+++ docs/CommandGuide/llvm-symbolizer.rst
@@ -128,6 +128,37 @@
Add the specified offset to object file addresses when performing lookups. This
can be used to perform lookups as if the object were relocated by the offset.
+.. option:: -output-style=<LLVM|GNU>
+
+ Specify the preffered output style. Defaults to ``LLVM``. When the output
+ style is set to ``GNU``, the tool follows the style of GNU's **addr2line**.
+ The differences from the default style are the following:
+
+ * Does not print column of a source code location.
+
+ * Does not add an empty line after the report for an address.
+
+ * Does not replace the name of an inlined function with the name of the
+ topmost caller when inlined frames are not shown and ``-use-symbol-table``
+ is on.
+
+ .. code-block:: console
+
+ $ llvm-symbolizer -p -e=addr.exe 0x40054d 0x400568
+ inc at /tmp/x.c:3:3
+ (inlined by) main at /tmp/x.c:14:0
+
+ main at /tmp/x.c:14:3
+
+ $ llvm-symbolizer --output-style=LLVM -p -i=0 -e=addr.exe 0x40054d 0x400568
+ main at /tmp/x.c:3:3
+
+ main at /tmp/x.c:14:3
+
+ $ llvm-symbolizer --output-style=GNU -p -i=0 -e=addr.exe 0x40054d 0x400568
+ inc at /tmp/x.c:3
+ main at /tmp/x.c:14
+
EXIT STATUS
-----------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60816.195542.patch
Type: text/x-patch
Size: 2095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190417/3de211d5/attachment.bin>
More information about the llvm-commits
mailing list