LLDB(1)

πŸ“¦
version 17.0.6 Β· 4 versions
, in debian trixie, ubuntu questing

πŸ’– LLDB(1) πŸ’–

okay bestie, welcome to the lldb manual page β€” it's a User Commands situation, and this is lldb 17 we're talking about. grab a strawberry drink πŸ“ and let's get into it.


✨ NAME ✨

lldb β€” manual page for lldb 17. that's it. that's the name. iconic behavior honestly πŸ‘‘


🌸 DESCRIPTION 🌸

OVERVIEW: LLDB

USAGE:

lldb [options]

so basically it's the debugger, it does debugger things, and there are so many flags. let's go through every single one, no skipping, periodt. πŸ’…

🫢 ATTACHING

these are the "hey lldb, go grab that process" options. very main character energy.

  • --attach-name <name> β€” Tells the debugger to attach to a process with the given name.
  • --attach-pid <pid> β€” Tells the debugger to attach to a process with the given pid.
  • -n <value> β€” Alias for --attach-name
  • -p <value> β€” Alias for --attach-pid
  • --wait-for β€” Tells the debugger to wait for a process with the given pid or name to launch before attaching.
  • -w β€” Alias for --wait-for

πŸ’œ COMMANDS

the "run these commands for me bestie" section. lowkey the most useful part fr fr.

  • --batch β€” Tells the debugger to run the commands from -s, -S, -o & -O, and then quit.
  • -b β€” Alias for --batch
  • -K <value> β€” Alias for --source-on-crash
  • -k <value> β€” Alias for --one-line-on-crash
  • --local-lldbinit β€” Allow the debugger to parse the .lldbinit files in the current working directory, unless --no-lldbinit is passed.
  • --no-lldbinit β€” Do not automatically parse any '.lldbinit' files.
  • --one-line-before-file <command> β€” Tells the debugger to execute this one-line lldb command before any file provided on the command line has been loaded.
  • --one-line-on-crash <command> β€” 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.
  • -O <value> β€” Alias for --one-line-before-file
  • -o <value> β€” Alias for --one-line
  • -Q β€” Alias for --source-quietly
  • --source-before-file <file> β€” Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded.
  • --source-on-crash <file> β€” When in batch mode, tells the debugger to source this file of lldb commands if the target crashes.
  • --source-quietly β€” Tells the debugger not to echo commands while sourcing files or one-line commands provided on the command line.
  • --source <file> β€” Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded.
  • -S <value> β€” Alias for --source-before-file
  • -s <value> β€” Alias for --source
  • -x β€” Alias for --no-lldbinit

πŸŽ€ OPTIONS

the general vibes section. architecture! core files! colors! it's giving customization ✨

  • --arch <architecture> β€” Tells the debugger to use the specified architecture when starting and running the program.
  • -a <value> β€” Alias for --arch
  • --core <filename> β€” Tells the debugger to use the full path to <filename> as the core file.
  • -c <value> β€” Alias for --core
  • --debug β€” Tells the debugger to print out extra information for debugging itself.
  • -d β€” Alias for --debug
  • --editor β€” Tells the debugger to open source files using the host's "external editor" mechanism.
  • -e β€” Alias for --editor
  • --file <filename> β€” Tells the debugger to use the file <filename> as the program to be debugged.
  • -f <value> β€” Alias for --file
  • --help β€” Prints out the usage information for the LLDB debugger.
  • -h β€” Alias for --help
  • --no-use-colors β€” Do not use colors.
  • --version β€” Prints out the current version number of the LLDB debugger.
  • -v β€” Alias for --version
  • -X β€” Alias for --no-use-color
heads up bestie: the original page lists -X as an alias for --no-use-color, and the actual option above is spelled --no-use-colors. i'm not fixing that, i'm just reporting it, because facts stay facts. πŸ™ˆ

πŸ¦‹ REPL

read-eval-print-loop mode. yes, the debugger has a whole interactive moment. slay.

  • -r=<flags> β€” 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.
  • --repl β€” Runs lldb in REPL mode with a stub process.
  • -R <value> β€” Alias for --repl-language
  • -r β€” Alias for --repl

🧚 SCRIPTING

for when you wanna get your python (or other language) on. very coder girlboss of you. πŸ’…

  • -l <value> β€” Alias for --script-language
  • --print-script-interpreter-info β€” Prints out a json dictionary with information about the scripting language interpreter.
  • --python-path β€” Prints out the path to the lldb.py file for this version of lldb.
  • -P β€” Alias for --python-path
  • --script-language <language> β€” Tells the debugger to use the specified scripting language for user-defined scripts.

🌈 EXAMPLES

bestie. the demo section. the moment we've all been waiting for. πŸ’–

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 --.

lldb --arch x86_64 /path/to/program program argument -- --arch armv7

For convenience, passing the executable after -- is also supported.

lldb --arch x86_64 -- /path/to/program program argument --arch armv7

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.

and that's the whole page bestie, you ate it. πŸ“βœ¨ this was lldb 17, dated June 2025, and it's the LLDB(1) page from the lldb 17 release β€” so go forth and debug, you absolute icon πŸ‘‘πŸ’– no cap.

πŸ“¦ where this page comes from