Scroll to navigation

LLDB(1) User Commands LLDB(1)

NAME

lldb - manual page for lldb 10

DESCRIPTION

OVERVIEW: LLDB

USAGE: lldb [options]

ATTACHING:

--attach-name <name> Tells the debugger to attach to a process with the given name.

Tells the debugger to attach to a process with the given pid.
Alias for --attach-name
Alias for --attach-pid
Tells the debugger to wait for a process with the given pid or name to launch before attaching.
Alias for --wait-for

COMMANDS:

Tells the debugger to run the commands from -s, -S, -o & -O, and then quit.
Alias for --batch
Alias for --source-on-crash
Alias for --one-line-on-crash
Allow the debugger to parse the .lldbinit files in the current working directory, unless --no-lldbinit is passed.
Do not automatically parse any '.lldbinit' files.
Tells the debugger to execute this one-line lldb command before any file provided on the command line has been loaded.
When in batch mode, tells the debugger to run this one-line lldb command if the target crashes.

--one-line <command> Tells the debugger to execute this one-line lldb command after any file provided on the command line has been loaded.

Alias for --one-line-before-file
Alias for --one-line
Alias for --source-quietly
Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded.
When in batch mode, tells the debugger to source this file of lldb commands if the target crashes.
Tells the debugger to execute this one-line lldb command before any file has been loaded.
Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded.
Alias for --source-before-file
Alias for --source
Alias for --no-lldbinit

OPTIONS:

--arch <architecture> Tells the debugger to use the specified architecture when starting and running the program.

Alias for --arch
Tells the debugger to use the given filename for the reproducer.
Tells the debugger to capture a reproducer.
Tells the debugger to use the full path to <filename> as the core file.
Alias for --core
Tells the debugger to print out extra information for debugging itself.
Alias for --debug
Tells the debugger to open source files using the host's "external editor" mechanism.
Alias for --editor
Tells the debugger to use the file <filename> as the program to be debugged.
Alias for --file
Prints out the usage information for the LLDB debugger.
Alias for --help
Do not use colors.
Tells the debugger to replay a reproducer from <filename>.
Skip the reproducer version check.
Prints out the current version number of the LLDB debugger.
Alias for --version
Alias for --no-use-color

REPL:

Alias for --repl=<flags>

--repl-language <language>

Chooses the language for the REPL.

--repl=<flags> Runs lldb in REPL mode with a stub process with the given flags.

Runs lldb in REPL mode with a stub process.
Alias for --repl-language
Alias for --repl

SCRIPTING:

Alias for --script-language

--python-path Prints out the path to the lldb.py file for this version of lldb.

Alias for --python-path

--script-language <language>

Tells the debugger to use the specified scripting language for user-defined scripts.

EXAMPLES:

The 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.
June 2020 lldb 10