150
|
1 .. title:: LLDB Homepage
|
|
2
|
|
3 The LLDB Debugger
|
|
4 =================
|
|
5
|
173
|
6 Welcome to the LLDB documentation!
|
150
|
7
|
|
8 LLDB is a next generation, high-performance debugger. It is built as a set of
|
|
9 reusable components which highly leverage existing libraries in the larger LLVM
|
|
10 Project, such as the Clang expression parser and LLVM disassembler.
|
|
11
|
|
12 LLDB is the default debugger in Xcode on macOS and supports debugging C,
|
|
13 Objective-C and C++ on the desktop and iOS devices and simulator.
|
|
14
|
|
15 All of the code in the LLDB project is available under the
|
|
16 `"Apache 2.0 License with LLVM exceptions"`_.
|
|
17
|
|
18 .. _"Apache 2.0 License with LLVM exceptions": https://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework
|
|
19
|
|
20 Using LLDB
|
|
21 ----------
|
|
22
|
|
23 For an introduction into the LLDB command language, head over to the `LLDB
|
|
24 Tutorial <https://lldb.llvm.org/use/tutorial.html>`_. For users already familiar
|
|
25 with GDB there is a cheat sheet listing common tasks and their LLDB equivalent
|
|
26 in the `GDB to LLDB command map <https://lldb.llvm.org/use/map.html>`_.
|
|
27
|
|
28 There are also multiple resources on how to script LLDB using Python `Python
|
|
29 Reference <https://lldb.llvm.org/use/python-reference.html>`_ is a great
|
|
30 starting point for that.
|
|
31
|
|
32 Compiler Integration Benefits
|
|
33 -----------------------------
|
|
34
|
|
35 LLDB converts debug information into Clang types so that it can
|
|
36 leverage the Clang compiler infrastructure. This allows LLDB to support the
|
|
37 latest C, C++, Objective-C and Objective-C++ language features and runtimes in
|
|
38 expressions without having to reimplement any of this functionality. It also
|
|
39 leverages the compiler to take care of all ABI details when making functions
|
|
40 calls for expressions, when disassembling instructions and extracting
|
|
41 instruction details, and much more.
|
|
42
|
|
43 The major benefits include:
|
|
44
|
|
45 - Up to date language support for C, C++, Objective-C
|
|
46 - Multi-line expressions that can declare local variables and types
|
|
47 - Utilize the JIT for expressions when supported
|
|
48 - Evaluate expression Intermediate Representation (IR) when JIT can't be used
|
|
49
|
|
50 Reusability
|
|
51 -----------
|
|
52
|
|
53 The LLDB debugger APIs are exposed as a C++ object oriented interface in a
|
|
54 shared library. The lldb command line tool links to, and uses this public API.
|
|
55 On macOS the shared library is exposed as a framework named LLDB.framework,
|
|
56 and Unix systems expose it as lldb.so. The entire API is also then exposed
|
|
57 through Python script bindings which allow the API to be used within the LLDB
|
|
58 embedded script interpreter, and also in any python script that loads the
|
|
59 lldb.py module in standard python script files. See the Python Reference page
|
|
60 for more details on how and where Python can be used with the LLDB API.
|
|
61
|
|
62 Sharing the LLDB API allows LLDB to not only be used for debugging, but also
|
|
63 for symbolication, disassembly, object and symbol file introspection, and much
|
|
64 more.
|
|
65
|
|
66 Platform Support
|
|
67 ----------------
|
|
68
|
|
69 LLDB is known to work on the following platforms, but ports to new platforms
|
|
70 are welcome:
|
|
71
|
221
|
72 * macOS debugging for i386, x86_64 and AArch64
|
|
73 * iOS, tvOS, and watchOS simulator debugging on i386, x86_64 and AArch64
|
150
|
74 * iOS, tvOS, and watchOS device debugging on ARM and AArch64
|
221
|
75 * Linux user-space debugging for i386, x86_64, ARM, AArch64, MIPS64, PPC64le,
|
|
76 s390x
|
|
77 * FreeBSD user-space debugging for i386, x86_64, ARM, AArch64, MIPS64, PPC
|
|
78 * NetBSD user-space debugging for i386 and x86_64
|
|
79 * Windows user-space debugging for i386, x86_64, ARM and AArch64 (*)
|
150
|
80
|
|
81 (*) Support for Windows is under active development. Basic functionality is
|
221
|
82 expected to work, with functionality improving rapidly. ARM and AArch64 support
|
|
83 is more experimental, with more known issues than the others.
|
150
|
84
|
|
85 Get Involved
|
|
86 ------------
|
|
87
|
|
88 Check out the LLVM source-tree with git and find the sources in the `lldb`
|
|
89 subdirectory:
|
|
90
|
|
91 ::
|
|
92
|
|
93 > git clone https://github.com/llvm/llvm-project.git
|
|
94
|
|
95 Note that LLDB generally builds from top-of-trunk using CMake and Ninja.
|
|
96 Additionally it builds:
|
|
97
|
|
98 * on macOS with a :ref:`generated Xcode project <CMakeGeneratedXcodeProject>`
|
|
99 * on Linux and FreeBSD with Clang and libstdc++/libc++
|
|
100 * on NetBSD with GCC/Clang and libstdc++/libc++
|
|
101 * on Windows with a generated project for VS 2017 or higher
|
|
102
|
|
103 See the :doc:`LLDB Build Page <resources/build>` for build instructions.
|
|
104
|
|
105 Discussions about LLDB should go to the `lldb-dev
|
|
106 <http://lists.llvm.org/mailman/listinfo/lldb-dev>`__ mailing list. Commit
|
|
107 messages are automatically sent to the `lldb-commits
|
|
108 <http://lists.llvm.org/mailman/listinfo/lldb-commits>`__ mailing list , and
|
|
109 this is also the preferred mailing list for patch submissions.
|
|
110
|
|
111 See the :doc:`Projects page <status/projects>` if you are looking for some
|
|
112 interesting areas to contribute to lldb.
|
|
113
|
|
114 .. toctree::
|
|
115 :hidden:
|
|
116 :maxdepth: 1
|
|
117 :caption: Project
|
|
118
|
|
119 status/goals
|
|
120 status/features
|
|
121 status/status
|
|
122 status/projects
|
|
123 status/releases
|
|
124
|
|
125 .. toctree::
|
|
126 :hidden:
|
|
127 :maxdepth: 1
|
|
128 :caption: Use & Extension
|
|
129
|
|
130 use/tutorial
|
|
131 use/map
|
|
132 use/formatting
|
|
133 use/variable
|
|
134 use/symbolication
|
|
135 use/symbols
|
|
136 use/python
|
|
137 use/python-reference
|
|
138 use/remote
|
221
|
139 use/qemu-testing
|
150
|
140 use/troubleshooting
|
221
|
141 use/links
|
150
|
142
|
|
143 .. toctree::
|
|
144 :hidden:
|
|
145 :maxdepth: 1
|
|
146 :caption: Development
|
|
147
|
|
148 resources/contributing
|
|
149 resources/build
|
|
150 resources/test
|
|
151 resources/bots
|
|
152 resources/caveats
|
|
153
|
221
|
154
|
|
155 .. toctree::
|
|
156 :hidden:
|
|
157 :maxdepth: 1
|
|
158 :caption: Design
|
|
159
|
|
160 design/overview
|
|
161 design/reproducers
|
|
162 design/structureddataplugins
|
|
163 design/sbapi
|
|
164
|
150
|
165 .. toctree::
|
|
166 :hidden:
|
|
167 :maxdepth: 1
|
|
168 :caption: Reference
|
|
169
|
221
|
170 Public Python API <python_api>
|
150
|
171 Public C++ API <https://lldb.llvm.org/cpp_reference/namespacelldb.html>
|
|
172 Private C++ API <https://lldb.llvm.org/cpp_reference/index.html>
|
|
173 Man Page <man/lldb>
|
|
174
|
|
175 .. toctree::
|
|
176 :hidden:
|
|
177 :maxdepth: 1
|
|
178 :caption: External Links
|
|
179
|
|
180 Source Code <https://github.com/llvm/llvm-project>
|
|
181 Code Reviews <https://reviews.llvm.org>
|
|
182 Bug Reports <https://bugs.llvm.org/>
|