[llvm] r358748 - [llvm-symbolizer] Unhide and document the "-output-style" option

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 19 03:14:19 PDT 2019


Author: ikudrin
Date: Fri Apr 19 03:14:18 2019
New Revision: 358748

URL: http://llvm.org/viewvc/llvm-project?rev=358748&view=rev
Log:
[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

Modified:
    llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst
    llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp

Modified: llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst?rev=358748&r1=358747&r2=358748&view=diff
==============================================================================
--- llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst (original)
+++ llvm/trunk/docs/CommandGuide/llvm-symbolizer.rst Fri Apr 19 03:14:18 2019
@@ -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
 -----------
 

Modified: llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp?rev=358748&r1=358747&r2=358748&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp (original)
+++ llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp Fri Apr 19 03:14:18 2019
@@ -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",




More information about the llvm-commits mailing list