Alexey Samsonov | 14809fd | 2013-03-01 07:58:27 +0000 | [diff] [blame] | 1 | llvm-symbolizer - convert addresses into source code locations |
| 2 | ============================================================== |
| 3 | |
| 4 | SYNOPSIS |
| 5 | -------- |
| 6 | |
| 7 | :program:`llvm-symbolizer` [options] |
| 8 | |
| 9 | DESCRIPTION |
| 10 | ----------- |
| 11 | |
| 12 | :program:`llvm-symbolizer` reads object file names and addresses from standard |
| 13 | input and prints corresponding source code locations to standard output. This |
| 14 | program uses debug info sections and symbol table in the object files. |
| 15 | |
| 16 | EXAMPLE |
| 17 | -------- |
| 18 | |
| 19 | .. code-block:: console |
| 20 | |
| 21 | $ cat addr.txt |
| 22 | a.out 0x4004f4 |
| 23 | /tmp/b.out 0x400528 |
| 24 | /tmp/c.so 0x710 |
Alexey Samsonov | 8175bc3 | 2013-06-28 08:15:40 +0000 | [diff] [blame] | 25 | /tmp/mach_universal_binary:i386 0x1f84 |
| 26 | /tmp/mach_universal_binary:x86_64 0x100000f24 |
Alexey Samsonov | 14809fd | 2013-03-01 07:58:27 +0000 | [diff] [blame] | 27 | $ llvm-symbolizer < addr.txt |
| 28 | main |
| 29 | /tmp/a.cc:4 |
| 30 | |
| 31 | f(int, int) |
| 32 | /tmp/b.cc:11 |
| 33 | |
| 34 | h_inlined_into_g |
| 35 | /tmp/header.h:2 |
| 36 | g_inlined_into_f |
| 37 | /tmp/header.h:7 |
| 38 | f_inlined_into_main |
| 39 | /tmp/source.cc:3 |
| 40 | main |
| 41 | /tmp/source.cc:8 |
| 42 | |
Alexey Samsonov | 8175bc3 | 2013-06-28 08:15:40 +0000 | [diff] [blame] | 43 | _main |
| 44 | /tmp/source_i386.cc:8 |
| 45 | |
| 46 | _main |
| 47 | /tmp/source_x86_64.cc:8 |
| 48 | |
Alexey Samsonov | 14809fd | 2013-03-01 07:58:27 +0000 | [diff] [blame] | 49 | OPTIONS |
| 50 | ------- |
| 51 | |
| 52 | .. option:: -functions |
| 53 | |
| 54 | Print function names as well as source file/line locations. Defaults to true. |
| 55 | |
| 56 | .. option:: -use-symbol-table |
| 57 | |
| 58 | Prefer function names stored in symbol table to function names |
| 59 | in debug info sections. Defaults to true. |
| 60 | |
| 61 | .. option:: -demangle |
| 62 | |
| 63 | Print demangled function names. Defaults to true. |
| 64 | |
| 65 | .. option:: -inlining |
| 66 | |
| 67 | If a source code location is in an inlined function, prints all the |
| 68 | inlnied frames. Defaults to true. |
| 69 | |
Alexey Samsonov | 8175bc3 | 2013-06-28 08:15:40 +0000 | [diff] [blame] | 70 | .. option:: -default-arch |
| 71 | |
| 72 | If a binary contains object files for multiple architectures (e.g. it is a |
| 73 | Mach-O universal binary), symbolize the object file for a given architecture. |
| 74 | You can also specify architecture by writing ``binary_name:arch_name`` in the |
| 75 | input (see example above). If architecture is not specified in either way, |
| 76 | address will not be symbolized. Defaults to empty string. |
| 77 | |
Alexey Samsonov | 14809fd | 2013-03-01 07:58:27 +0000 | [diff] [blame] | 78 | EXIT STATUS |
| 79 | ----------- |
| 80 | |
| 81 | :program:`llvm-symbolizer` returns 0. Other exit codes imply internal program error. |