|
NAMElldb - LLDB DocumentationSYNOPSISlldb [options] executable DESCRIPTIONlldb 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.lldb is the default debugger in Xcode on macOS and supports debugging C, Objective-C and C++ on the desktop and iOS devices and simulator. All of the code in the LLDB project is available under the Apache 2.0 License with LLVM exceptions. ATTACHING
COMMANDS
OPTIONS
REPL
SCRIPTING
EXAMPLESThe debugger can be started in several modes.Passing an executable as a positional argument prepares lldb to debug the given executable. Arguments passed after -- are considered arguments to the debugged executable. lldb --arch x86_64 /path/to/program -- --arch arvm7
Passing one of the attach options causes lldb to immediately attach to the given process. lldb -p <pid> lldb -n <process-name>
Passing --repl starts lldb in REPL mode. lldb -r
Passing --core causes lldb to debug the core file. lldb -c /path/to/core
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. lldb -O 'settings set stop-disassembly-count 20' -o 'run'
-o 'bt' lldb -S /source/before/file -s /source/after/file lldb -K
/source/before/crash -k /source/after/crash
Note: In REPL mode no file is loaded, so commands specified to run after loading the file (via -o or -s) will be ignored. USING LLDBIn 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. CONFIGURATION FILESlldb reads things like settings, aliases and commands from the .lldbinit file. It will first look for ~/.lldbinit and load that first. 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: settings set target.load-cwd-lldbinit true
To never load the .lldbinit file in the current working directory and silence the warning, add the following command to ~/.lldbinit: settings set target.load-cwd-lldbinit false
SEE ALSOThe 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.AUTHORLLVM projectCOPYRIGHT2007-2022, The LLDB Team
Visit the GSP FreeBSD Man Page Interface. |