73babb1e5c559ad0bddb9819a9d9dadaabf60fc0
[oota-llvm.git] / docs / CommandGuide / llvm-symbolizer.rst
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
25   $ llvm-symbolizer < addr.txt
26   main
27   /tmp/a.cc:4
28   
29   f(int, int)
30   /tmp/b.cc:11
31
32   h_inlined_into_g
33   /tmp/header.h:2
34   g_inlined_into_f
35   /tmp/header.h:7
36   f_inlined_into_main
37   /tmp/source.cc:3
38   main
39   /tmp/source.cc:8
40
41 OPTIONS
42 -------
43
44 .. option:: -functions
45
46   Print function names as well as source file/line locations. Defaults to true.
47
48 .. option:: -use-symbol-table
49
50  Prefer function names stored in symbol table to function names
51  in debug info sections. Defaults to true.
52
53 .. option:: -demangle
54
55  Print demangled function names. Defaults to true.
56
57 .. option:: -inlining 
58
59  If a source code location is in an inlined function, prints all the
60  inlnied frames. Defaults to true.
61
62 EXIT STATUS
63 -----------
64
65 :program:`llvm-symbolizer` returns 0. Other exit codes imply internal program error.