llvm.org GIT mirror llvm / e78c62a
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358748 91177308-0d34-0410-b5e6-96231b3b80d8 Igor Kudrin 1 year, 6 months ago
2 changed file(s) with 32 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
127127 Add the specified offset to object file addresses when performing lookups. This
128128 can be used to perform lookups as if the object were relocated by the offset.
129129
130 .. option:: -output-style=
131
132 Specify the preferred output style. Defaults to ``LLVM``. When the output
133 style is set to ``GNU``, the tool follows the style of GNU's **addr2line**.
134 The differences from the ``LLVM`` style are:
135
136 * Does not print column of a source code location.
137
138 * Does not add an empty line after the report for an address.
139
140 * Does not replace the name of an inlined function with the name of the
141 topmost caller when inlined frames are not shown and ``-use-symbol-table``
142 is on.
143
144 .. code-block:: console
145
146 $ llvm-symbolizer -p -e=addr.exe 0x40054d 0x400568
147 inc at /tmp/x.c:3:3
148 (inlined by) main at /tmp/x.c:14:0
149
150 main at /tmp/x.c:14:3
151
152 $ llvm-symbolizer --output-style=LLVM -p -i=0 -e=addr.exe 0x40054d 0x400568
153 main at /tmp/x.c:3:3
154
155 main at /tmp/x.c:14:3
156
157 $ llvm-symbolizer --output-style=GNU -p -i=0 -e=addr.exe 0x40054d 0x400568
158 inc at /tmp/x.c:3
159 main at /tmp/x.c:14
160
130161 EXIT STATUS
131162 -----------
132163
147147
148148 static cl::opt
149149 ClOutputStyle("output-style", cl::init(DIPrinter::OutputStyle::LLVM),
150 cl::desc("Specify print style"), cl::Hidden,
150 cl::desc("Specify print style"),
151151 cl::values(clEnumValN(DIPrinter::OutputStyle::LLVM, "LLVM",
152152 "LLVM default style"),
153153 clEnumValN(DIPrinter::OutputStyle::GNU, "GNU",