LLDB(1) | LLDB | LLDB(1) |
lldb - LLDB Documentation
lldb [options] executable
lldb is a fully featured debugger. It is a command line interface to the LLDB debugger library.
The debugger can be started in several modes.
Passing an executable as a positional argument prepares lldb to debug the given executable. To disambiguate between arguments passed to lldb and arguments passed to the debugged executable, arguments starting with a - must be passed after --.
For convenience, passing the executable after -- is also supported.
Passing one of the attach options causes lldb to immediately attach to the given process.
Passing --repl starts lldb in REPL mode.
Passing --core causes lldb to debug the core file.
Command options can be combined with these modes and cause lldb to run the specified commands before or after events, like loading the file or crashing, in the order provided on the command line.
Note: In REPL mode no file is loaded, so commands specified to run after loading the file (via -o or -s) will be ignored.
In lldb there is a help command which can be used to find descriptions and examples of all lldb commands. To get help on "breakpoint set" you would type "help breakpoint set".
There is also an apropos command which will search the help text of all commands for a given term ‐‐ this is useful for locating a command by topic. For instance, "apropos breakpoint" will list any command that has the word "breakpoint" in its help text.
lldb reads things like settings, aliases and commands from the .lldbinit file.
First, it will read the application specific init file whose name is ~/.lldbinit followed by a "-" and the name of the current program. This would be ~/.lldbinit-lldb for the command line lldb and ~/.lldbinit-Xcode for Xcode. If there is no application specific init file, the global ~/.lldbinit is read.
Secondly, it will look for an .lldbinit file in the current working directory. For security reasons, lldb will print a warning and not source this file by default. This behavior can be changed by changing the target.load-cwd-lldbinit setting.
To always load the .lldbinit file in the current working directory, add the following command to ~/.lldbinit:
To never load the .lldbinit file in the current working directory and silence the warning, add the following command to ~/.lldbinit:
The LLDB project page https://lldb.llvm.org has many different resources for lldb users ‐‐ the gdb/lldb command equivalence page https://lldb.llvm.org/use/map.html can be especially helpful for users coming from gdb.
LLVM project
2007-2020, The LLDB Team
June 10, 2020 | 8 |