5b72ffe827
* bugpoint.1 * clang.1 * llc.1 * lldb.1 * lli.1 * llvm-ar.1 * llvm-as.1 * llvm-bcanalyzer.1 * llvm-cov.1 * llvm-diff.1 * llvm-dis.1 * llvm-dwarfdump.1 * llvm-extract.1 * llvm-link.1 * llvm-mca.1 * llvm-nm.1 * llvm-pdbutil.1 * llvm-profdata.1 * llvm-symbolizer.1 * llvm-tblgen.1 * opt.1 Add newly generated manpages for: * llvm-addr2line.1 (this is an alias of llvm-symbolizer) * llvm-cxxfilt.1 * llvm-objcopy.1 * llvm-ranlib.1 (this is an alias of llvm-ar) Note that llvm-objdump.1 is an exception, as upstream has both a plain .1 file, and a .rst variant. These will have to be reconciled upstream first. MFC after: 3 days
473 lines
10 KiB
Groff
473 lines
10 KiB
Groff
.\" $FreeBSD$
|
|
.\" Man page generated from reStructuredText.
|
|
.
|
|
.TH "LLVM-SYMBOLIZER" "1" "2020-06-26" "10" "LLVM"
|
|
.SH NAME
|
|
llvm-symbolizer \- convert addresses into source code locations
|
|
.
|
|
.nr rst2man-indent-level 0
|
|
.
|
|
.de1 rstReportMargin
|
|
\\$1 \\n[an-margin]
|
|
level \\n[rst2man-indent-level]
|
|
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
-
|
|
\\n[rst2man-indent0]
|
|
\\n[rst2man-indent1]
|
|
\\n[rst2man-indent2]
|
|
..
|
|
.de1 INDENT
|
|
.\" .rstReportMargin pre:
|
|
. RS \\$1
|
|
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
|
|
. nr rst2man-indent-level +1
|
|
.\" .rstReportMargin post:
|
|
..
|
|
.de UNINDENT
|
|
. RE
|
|
.\" indent \\n[an-margin]
|
|
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
.nr rst2man-indent-level -1
|
|
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
|
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
|
..
|
|
.SH SYNOPSIS
|
|
.sp
|
|
\fBllvm\-symbolizer\fP [\fIoptions\fP] [\fIaddresses...\fP]
|
|
.SH DESCRIPTION
|
|
.sp
|
|
\fBllvm\-symbolizer\fP reads object file names and addresses from the
|
|
command\-line and prints corresponding source code locations to standard output.
|
|
.sp
|
|
If no address is specified on the command\-line, it reads the addresses from
|
|
standard input. If no object file is specified on the command\-line, but
|
|
addresses are, or if at any time an input value is not recognized, the input is
|
|
simply echoed to the output.
|
|
.sp
|
|
A positional argument or standard input value can be preceded by "DATA" or
|
|
"CODE" to indicate that the address should be symbolized as data or executable
|
|
code respectively. If neither is specified, "CODE" is assumed. DATA is
|
|
symbolized as address and symbol size rather than line number.
|
|
.sp
|
|
Object files can be specified together with the addresses either on standard
|
|
input or as positional arguments on the command\-line, following any "DATA" or
|
|
"CODE" prefix.
|
|
.sp
|
|
\fBllvm\-symbolizer\fP parses options from the environment variable
|
|
\fBLLVM_SYMBOLIZER_OPTS\fP after parsing options from the command line.
|
|
\fBLLVM_SYMBOLIZER_OPTS\fP is primarily useful for supplementing the command\-line
|
|
options when \fBllvm\-symbolizer\fP is invoked by another program or
|
|
runtime.
|
|
.SH EXAMPLES
|
|
.sp
|
|
All of the following examples use the following two source files as input. They
|
|
use a mixture of C\-style and C++\-style linkage to illustrate how these names are
|
|
printed differently (see \fI\%\-\-demangle\fP).
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
// test.h
|
|
extern "C" inline int foz() {
|
|
return 1234;
|
|
}
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
// test.cpp
|
|
#include "test.h"
|
|
int bar=42;
|
|
|
|
int foo() {
|
|
return bar;
|
|
}
|
|
|
|
int baz() {
|
|
volatile int k = 42;
|
|
return foz() + k;
|
|
}
|
|
|
|
int main() {
|
|
return foo() + baz();
|
|
}
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.sp
|
|
These files are built as follows:
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ clang \-g test.cpp \-o test.elf
|
|
$ clang \-g \-O2 test.cpp \-o inlined.elf
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.sp
|
|
Example 1 \- addresses and object on command\-line:
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ llvm\-symbolizer \-\-obj=test.elf 0x4004d0 0x400490
|
|
foz
|
|
/tmp/test.h:1:0
|
|
|
|
baz()
|
|
/tmp/test.cpp:11:0
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.sp
|
|
Example 2 \- addresses on standard input:
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ cat addr.txt
|
|
0x4004a0
|
|
0x400490
|
|
0x4004d0
|
|
$ llvm\-symbolizer \-\-obj=test.elf < addr.txt
|
|
main
|
|
/tmp/test.cpp:15:0
|
|
|
|
baz()
|
|
/tmp/test.cpp:11:0
|
|
|
|
foz
|
|
/tmp/./test.h:1:0
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.sp
|
|
Example 3 \- object specified with address:
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ llvm\-symbolizer "test.elf 0x400490" "inlined.elf 0x400480"
|
|
baz()
|
|
/tmp/test.cpp:11:0
|
|
|
|
foo()
|
|
/tmp/test.cpp:8:10
|
|
|
|
$ cat addr2.txt
|
|
test.elf 0x4004a0
|
|
inlined.elf 0x400480
|
|
|
|
$ llvm\-symbolizer < addr2.txt
|
|
main
|
|
/tmp/test.cpp:15:0
|
|
|
|
foo()
|
|
/tmp/test.cpp:8:10
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.sp
|
|
Example 4 \- CODE and DATA prefixes:
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ llvm\-symbolizer \-\-obj=test.elf "CODE 0x400490" "DATA 0x601028"
|
|
baz()
|
|
/tmp/test.cpp:11:0
|
|
|
|
bar
|
|
6295592 4
|
|
|
|
$ cat addr3.txt
|
|
CODE test.elf 0x4004a0
|
|
DATA inlined.elf 0x601028
|
|
|
|
$ llvm\-symbolizer < addr3.txt
|
|
main
|
|
/tmp/test.cpp:15:0
|
|
|
|
bar
|
|
6295592 4
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.SH OPTIONS
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-adjust\-vma <offset>
|
|
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.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-basenames, \-s
|
|
Strip directories when printing the file path.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-demangle, \-C
|
|
Print demangled function names, if the names are mangled (e.g. the mangled
|
|
name \fI_Z3bazv\fP becomes \fIbaz()\fP, whilst the non\-mangled name \fIfoz\fP is printed
|
|
as is). Defaults to true.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-dwp <path>
|
|
Use the specified DWP file at \fB<path>\fP for any CUs that have split DWARF
|
|
debug data.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-fallback\-debug\-path <path>
|
|
When a separate file contains debug data, and is referenced by a GNU debug
|
|
link section, use the specified path as a basis for locating the debug data if
|
|
it cannot be found relative to the object.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-functions [<none|short|linkage>], \-f
|
|
Specify the way function names are printed (omit function name, print short
|
|
function name, or print full linkage name, respectively). Defaults to
|
|
\fBlinkage\fP\&.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-help, \-h
|
|
Show help and usage for this command.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-help\-list
|
|
Show help and usage for this command without grouping the options into categories.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-inlining, \-\-inlines, \-i
|
|
If a source code location is in an inlined function, prints all the inlined
|
|
frames. Defaults to true.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-no\-demangle
|
|
Don\(aqt print demangled function names.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-obj <path>, \-\-exe, \-e
|
|
Path to object file to be symbolized. If \fB\-\fP is specified, read the object
|
|
directly from the standard input stream.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-output\-style <LLVM|GNU>
|
|
Specify the preferred output style. Defaults to \fBLLVM\fP\&. When the output
|
|
style is set to \fBGNU\fP, the tool follows the style of GNU\(aqs \fBaddr2line\fP\&.
|
|
The differences from the \fBLLVM\fP style are:
|
|
.INDENT 7.0
|
|
.IP \(bu 2
|
|
Does not print the column of a source code location.
|
|
.IP \(bu 2
|
|
Does not add an empty line after the report for an address.
|
|
.IP \(bu 2
|
|
Does not replace the name of an inlined function with the name of the
|
|
topmost caller when inlined frames are not shown and \fI\%\-\-use\-symbol\-table\fP
|
|
is on.
|
|
.UNINDENT
|
|
.INDENT 7.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ llvm\-symbolizer \-\-obj=inlined.elf 0x4004be 0x400486 \-p
|
|
baz() at /tmp/test.cpp:11:18
|
|
(inlined by) main at /tmp/test.cpp:15:0
|
|
|
|
foo() at /tmp/test.cpp:6:3
|
|
|
|
$ llvm\-symbolizer \-\-output\-style=LLVM \-\-obj=inlined.elf 0x4004be 0x400486 \-p \-i=0
|
|
main at /tmp/test.cpp:11:18
|
|
|
|
foo() at /tmp/test.cpp:6:3
|
|
|
|
$ llvm\-symbolizer \-\-output\-style=GNU \-\-obj=inlined.elf 0x4004be 0x400486 \-p \-i=0
|
|
baz() at /tmp/test.cpp:11
|
|
foo() at /tmp/test.cpp:6
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-pretty\-print, \-p
|
|
Print human readable output. If \fI\%\-\-inlining\fP is specified, the
|
|
enclosing scope is prefixed by (inlined by).
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ llvm\-symbolizer \-\-obj=inlined.elf 0x4004be \-\-inlining \-\-pretty\-print
|
|
baz() at /tmp/test.cpp:11:18
|
|
(inlined by) main at /tmp/test.cpp:15:0
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-print\-address, \-\-addresses, \-a
|
|
Print address before the source code location. Defaults to false.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ llvm\-symbolizer \-\-obj=inlined.elf \-\-print\-address 0x4004be
|
|
0x4004be
|
|
baz()
|
|
/tmp/test.cpp:11:18
|
|
main
|
|
/tmp/test.cpp:15:0
|
|
|
|
$ llvm\-symbolizer \-\-obj=inlined.elf 0x4004be \-\-pretty\-print \-\-print\-address
|
|
0x4004be: baz() at /tmp/test.cpp:11:18
|
|
(inlined by) main at /tmp/test.cpp:15:0
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-print\-source\-context\-lines <N>
|
|
Print \fBN\fP lines of source context for each symbolized address.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ llvm\-symbolizer \-\-obj=test.elf 0x400490 \-\-print\-source\-context\-lines=2
|
|
baz()
|
|
/tmp/test.cpp:11:0
|
|
10 : volatile int k = 42;
|
|
11 >: return foz() + k;
|
|
12 : }
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-use\-symbol\-table
|
|
Prefer function names stored in symbol table to function names in debug info
|
|
sections. Defaults to true.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-verbose
|
|
Print verbose line and column information.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ llvm\-symbolizer \-\-obj=inlined.elf \-\-verbose 0x4004be
|
|
baz()
|
|
Filename: /tmp/test.cpp
|
|
Function start line: 9
|
|
Line: 11
|
|
Column: 18
|
|
main
|
|
Filename: /tmp/test.cpp
|
|
Function start line: 14
|
|
Line: 15
|
|
Column: 0
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-version
|
|
Print version information for the tool.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B @<FILE>
|
|
Read command\-line options from response file \fI<FILE>\fP\&.
|
|
.UNINDENT
|
|
.SH MACH-O SPECIFIC OPTIONS
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-default\-arch <arch>
|
|
If a binary contains object files for multiple architectures (e.g. it is a
|
|
Mach\-O universal binary), symbolize the object file for a given architecture.
|
|
You can also specify the architecture by writing \fBbinary_name:arch_name\fP in
|
|
the input (see example below). If the architecture is not specified in either
|
|
way, the address will not be symbolized. Defaults to empty string.
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.INDENT 3.5
|
|
.sp
|
|
.nf
|
|
.ft C
|
|
$ cat addr.txt
|
|
/tmp/mach_universal_binary:i386 0x1f84
|
|
/tmp/mach_universal_binary:x86_64 0x100000f24
|
|
|
|
$ llvm\-symbolizer < addr.txt
|
|
_main
|
|
/tmp/source_i386.cc:8
|
|
|
|
_main
|
|
/tmp/source_x86_64.cc:8
|
|
.ft P
|
|
.fi
|
|
.UNINDENT
|
|
.UNINDENT
|
|
.INDENT 0.0
|
|
.TP
|
|
.B \-\-dsym\-hint <path/to/file.dSYM>
|
|
If the debug info for a binary isn\(aqt present in the default location, look for
|
|
the debug info at the .dSYM path provided via this option. This flag can be
|
|
used multiple times.
|
|
.UNINDENT
|
|
.SH EXIT STATUS
|
|
.sp
|
|
\fBllvm\-symbolizer\fP returns 0. Other exit codes imply an internal program
|
|
error.
|
|
.SH SEE ALSO
|
|
.sp
|
|
\fBllvm\-addr2line(1)\fP
|
|
.SH AUTHOR
|
|
Maintained by the LLVM Team (https://llvm.org/).
|
|
.SH COPYRIGHT
|
|
2003-2020, LLVM Project
|
|
.\" Generated by docutils manpage writer.
|
|
.
|