2019-05-14 10:31:56 +08:00
|
|
|
.. title:: LLDB Homepage
|
2019-01-31 02:51:40 +08:00
|
|
|
|
2019-05-14 10:31:56 +08:00
|
|
|
The LLDB Debugger
|
|
|
|
=================
|
|
|
|
|
|
|
|
Welcome to the LLDB version |release| documentation!
|
2019-01-31 02:51:40 +08:00
|
|
|
|
|
|
|
LLDB is a next generation, high-performance debugger. It is built as a set of
|
|
|
|
reusable components which highly leverage existing libraries in the larger LLVM
|
|
|
|
Project, such as the Clang expression parser and LLVM disassembler.
|
|
|
|
|
2019-03-30 00:12:27 +08:00
|
|
|
LLDB is the default debugger in Xcode on macOS and supports debugging C,
|
2019-01-31 02:51:40 +08:00
|
|
|
Objective-C and C++ on the desktop and iOS devices and simulator.
|
|
|
|
|
2019-05-16 05:58:43 +08:00
|
|
|
All of the code in the LLDB project is available under the
|
|
|
|
`"Apache 2.0 License with LLVM exceptions"`_.
|
|
|
|
|
2019-08-29 15:20:08 +08:00
|
|
|
.. _"Apache 2.0 License with LLVM exceptions": https://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework
|
2019-01-31 02:51:40 +08:00
|
|
|
|
2019-05-16 05:49:00 +08:00
|
|
|
Why a New Debugger?
|
|
|
|
-------------------
|
2019-01-31 02:51:40 +08:00
|
|
|
|
2019-05-16 05:49:00 +08:00
|
|
|
In order to achieve our goals we decided to start with a fresh architecture
|
|
|
|
that would support modern multi-threaded programs, handle debugging symbols in
|
|
|
|
an efficient manner, use compiler based code knowledge and have plug-in support
|
|
|
|
for functionality and extensions. Additionally we want the debugger
|
|
|
|
capabilities to be available to other analysis tools, be they scripts or
|
|
|
|
compiled programs, without requiring them to be GPL.
|
|
|
|
|
|
|
|
Compiler Integration Benefits
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
LLDB currently converts debug information into clang types so that it can
|
|
|
|
leverage the clang compiler infrastructure. This allows LLDB to support the
|
|
|
|
latest C, C++, Objective-C and Objective-C++ language features and runtimes in
|
|
|
|
expressions without having to reimplement any of this functionality. It also
|
|
|
|
leverages the compiler to take care of all ABI details when making functions
|
|
|
|
calls for expressions, when disassembling instructions and extracting
|
|
|
|
instruction details, and much more.
|
|
|
|
|
|
|
|
The major benefits include:
|
|
|
|
|
|
|
|
- Up to date language support for C, C++, Objective-C
|
|
|
|
- Multi-line expressions that can declare local variables and types
|
|
|
|
- Utilize the JIT for expressions when supported
|
|
|
|
- Evaluate expression Intermediate Representation (IR) when JIT can't be used
|
|
|
|
|
|
|
|
Reusability
|
|
|
|
-----------
|
|
|
|
|
|
|
|
The LLDB debugger APIs are exposed as a C++ object oriented interface in a
|
|
|
|
shared library. The lldb command line tool links to, and uses this public API.
|
|
|
|
On macOS the shared library is exposed as a framework named LLDB.framework,
|
|
|
|
and unix systems expose it as lldb.so. The entire API is also then exposed
|
|
|
|
through Python script bindings which allow the API to be used within the LLDB
|
|
|
|
embedded script interpreter, and also in any python script that loads the
|
|
|
|
lldb.py module in standard python script files. See the Python Reference page
|
|
|
|
for more details on how and where Python can be used with the LLDB API.
|
|
|
|
|
|
|
|
Sharing the LLDB API allows LLDB to not only be used for debugging, but also
|
|
|
|
for symbolication, disassembly, object and symbol file introspection, and much
|
|
|
|
more.
|
|
|
|
|
|
|
|
Platform Support
|
|
|
|
----------------
|
|
|
|
|
|
|
|
LLDB is known to work on the following platforms, but ports to new platforms
|
|
|
|
are welcome:
|
|
|
|
|
2019-05-18 01:05:23 +08:00
|
|
|
* macOS desktop user space debugging for i386 and x86_64
|
|
|
|
* iOS simulator debugging on i386 and x86_64
|
|
|
|
* iOS device debugging on ARM and AArch64
|
|
|
|
* Linux local user-space debugging for i386, x86_64 and PPC64le
|
|
|
|
* FreeBSD local user-space debugging for i386 and x86_64
|
2019-05-16 05:49:00 +08:00
|
|
|
* Windows local user-space debugging for i386 (*)
|
|
|
|
|
|
|
|
(*) Support for Windows is under active development. Basic functionality is
|
|
|
|
expected to work, with functionality improving rapidly.
|
|
|
|
|
|
|
|
Get Involved
|
|
|
|
------------
|
|
|
|
|
2019-08-01 18:33:54 +08:00
|
|
|
Check out the LLVM source-tree with git and find the sources in the `lldb`
|
|
|
|
subdirectory:
|
2019-05-16 05:49:00 +08:00
|
|
|
|
2019-08-01 18:33:54 +08:00
|
|
|
::
|
2019-05-16 05:49:00 +08:00
|
|
|
|
2019-08-01 18:33:54 +08:00
|
|
|
> git clone https://github.com/llvm/llvm-project.git
|
2019-05-16 05:49:00 +08:00
|
|
|
|
2019-08-01 18:33:54 +08:00
|
|
|
Note that LLDB generally builds from top-of-trunk using CMake and Ninja.
|
|
|
|
Additionally it builds:
|
2019-05-16 05:49:00 +08:00
|
|
|
|
2019-08-01 18:33:54 +08:00
|
|
|
* on macOS with a :ref:`generated Xcode project <CMakeGeneratedXcodeProject>`
|
|
|
|
* on Linux and FreeBSD with clang and libstdc++/libc++
|
|
|
|
* on NetBSD with GCC/clang and libstdc++/libc++
|
|
|
|
* on Windows with a generated project for VS 2017 or higher
|
|
|
|
|
|
|
|
See the :doc:`LLDB Build Page <resources/build>` for build instructions.
|
2019-05-16 05:49:00 +08:00
|
|
|
|
|
|
|
Discussions about LLDB should go to the `lldb-dev
|
|
|
|
<http://lists.llvm.org/mailman/listinfo/lldb-dev>`__ mailing list. Commit
|
2019-08-01 18:33:54 +08:00
|
|
|
messages are automatically sent to the `lldb-commits
|
2019-05-16 05:49:00 +08:00
|
|
|
<http://lists.llvm.org/mailman/listinfo/lldb-commits>`__ mailing list , and
|
|
|
|
this is also the preferred mailing list for patch submissions.
|
|
|
|
|
2019-08-01 18:33:54 +08:00
|
|
|
See the :doc:`Projects page <status/projects>` if you are looking for some
|
|
|
|
interesting areas to contribute to lldb.
|
2019-01-31 02:51:40 +08:00
|
|
|
|
|
|
|
.. toctree::
|
2019-05-16 05:49:00 +08:00
|
|
|
:hidden:
|
2019-01-31 02:51:40 +08:00
|
|
|
:maxdepth: 1
|
2019-05-16 05:49:00 +08:00
|
|
|
:caption: Goals & Status
|
2019-01-31 02:51:40 +08:00
|
|
|
|
|
|
|
status/goals
|
|
|
|
status/features
|
|
|
|
status/status
|
|
|
|
status/projects
|
|
|
|
|
|
|
|
.. toctree::
|
2019-05-16 05:49:00 +08:00
|
|
|
:hidden:
|
2019-01-31 02:51:40 +08:00
|
|
|
:maxdepth: 1
|
2019-05-16 05:49:00 +08:00
|
|
|
:caption: Use & Extension
|
2019-01-31 02:51:40 +08:00
|
|
|
|
|
|
|
use/tutorial
|
|
|
|
use/map
|
|
|
|
use/formatting
|
|
|
|
use/variable
|
|
|
|
use/symbolication
|
|
|
|
use/symbols
|
|
|
|
use/python
|
2019-05-10 06:14:14 +08:00
|
|
|
use/python-reference
|
2019-01-31 02:51:40 +08:00
|
|
|
use/remote
|
|
|
|
use/troubleshooting
|
|
|
|
use/architecture
|
|
|
|
|
|
|
|
.. toctree::
|
2019-05-16 05:49:00 +08:00
|
|
|
:hidden:
|
2019-01-31 02:51:40 +08:00
|
|
|
:maxdepth: 1
|
2019-05-16 05:49:00 +08:00
|
|
|
:caption: Resources
|
2019-01-31 02:51:40 +08:00
|
|
|
|
2019-10-29 06:01:27 +08:00
|
|
|
resources/contributing
|
2019-01-31 02:51:40 +08:00
|
|
|
resources/build
|
|
|
|
resources/test
|
2019-04-19 01:31:20 +08:00
|
|
|
resources/bots
|
2019-01-31 02:51:40 +08:00
|
|
|
resources/sbapi
|
2019-10-29 06:01:27 +08:00
|
|
|
resources/download
|
2019-01-31 02:51:40 +08:00
|
|
|
|
2019-05-16 05:49:00 +08:00
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:maxdepth: 1
|
|
|
|
:caption: API Documentation
|
2019-04-23 06:41:55 +08:00
|
|
|
|
2019-05-16 05:49:00 +08:00
|
|
|
Public Python API Reference <https://lldb.llvm.org/python_reference/index.html>
|
|
|
|
Public C++ API Reference <https://lldb.llvm.org/cpp_reference/namespacelldb.html>
|
|
|
|
Private C++ Reference <https://lldb.llvm.org/cpp_reference/index.html>
|
2019-04-23 06:41:55 +08:00
|
|
|
|
2019-05-16 05:49:00 +08:00
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
:maxdepth: 1
|
|
|
|
:caption: External Links
|
2019-01-31 02:51:40 +08:00
|
|
|
|
2019-10-29 02:14:49 +08:00
|
|
|
Source Code <https://github.com/llvm/llvm-project>
|
2019-05-16 05:49:00 +08:00
|
|
|
Code Reviews <https://reviews.llvm.org>
|
|
|
|
Bug Reports <https://bugs.llvm.org/>
|