summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin@accesssoftek.com>2019-04-19 10:14:18 +0000
committerIgor Kudrin <ikudrin@accesssoftek.com>2019-04-19 10:14:18 +0000
commit1b71b7f3b8869d00ec0da81dacfa738b907df8cf (patch)
tree5f0edd33c49ad9a198ba9d56f467e392a634cef9
parent4bc29cbf6b393f8e4219043ba0fb901d734e0bcd (diff)
downloadbcm5719-llvm-1b71b7f3b8869d00ec0da81dacfa738b907df8cf.tar.gz
bcm5719-llvm-1b71b7f3b8869d00ec0da81dacfa738b907df8cf.zip
[llvm-symbolizer] Unhide and document the "-output-style" option
With the latest changes, the option gets useful for users of llvm-symbolizer, not only for the upcoming llvm-addr2line. Differential Revision: https://reviews.llvm.org/D60816 llvm-svn: 358748
-rw-r--r--llvm/docs/CommandGuide/llvm-symbolizer.rst31
-rw-r--r--llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp2
2 files changed, 32 insertions, 1 deletions
diff --git a/llvm/docs/CommandGuide/llvm-symbolizer.rst b/llvm/docs/CommandGuide/llvm-symbolizer.rst
index b794f56246f..4dd6d9bf28b 100644
--- a/llvm/docs/CommandGuide/llvm-symbolizer.rst
+++ b/llvm/docs/CommandGuide/llvm-symbolizer.rst
@@ -128,6 +128,37 @@ OPTIONS
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 preferred 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 ``LLVM`` style are:
+
+ * 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
-----------
diff --git a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
index c57f5f85c86..aa6635fc92f 100644
--- a/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
+++ b/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
@@ -148,7 +148,7 @@ static cl::opt<std::string>
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",
OpenPOWER on IntegriCloud