LLDB(1)
π LLDB π
okay bestie, gather round, because we're about to talk about lldb β yes, the manual page for lldb 18, the debugger that's about to become your whole personality. this is a User Command, it's iconic, it's giving main character energy, and i'm gonna walk you through every single flag like we're doing a group project and i actually did the work. π«Ά
β¨ NAME β¨
lldb β manual page for lldb 18. that's it, that's the name, short and slay. π
πΈ DESCRIPTION πΈ
OVERVIEW: LLDB. literally the whole vibe.
USAGE:
lldb [options]
π ATTACHING π
like, you wanna just slide into a running process? no cap, these are the flags for that.
--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. it's giving patience. π§-wβ alias for--wait-for.
π¦ COMMANDS π¦
the way that lldb can just run stuff for you before you even open your mouth?? obsessed. these control what commands run and when.
--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.lldbinitfiles in the current working directory, unless--no-lldbinitis 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. shhh π€«--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 classics. the staples. the ones you'll actually type at 3am.
--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. debugception fr fr.-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. (sad, but valid π)--versionβ prints out the current version number of the LLDB debugger.-vβ alias for--version.-Xβ alias for--no-use-color.
β οΈ bestie, heads up: the original page literally writes that last alias as--no-use-color(nos), even though the actual flag up top is--no-use-colors. i'm just the messenger, i'm not fixing it, i'm reporting it. π
π REPL π
read-eval-print-loop but make it cute. stub process included, flags welcome.
-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 hands in there and script the whole thing. iykyk.
-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 thelldb.pyfile 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 β
okay this part is the fun part. the debugger can be started in several modes. let's gooo.
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-oor-s) will be ignored. lowkey important, don't @ me.
and that's the whole page bestie!! πβ¨ this gem is from lldb 18, dated June 2025, filed under User Commands, and it's a full-on LLDB(1) moment. go debug something iconic, you absolute legend. πππ¦
π¦ where this page comes from
- debian trixie: lldb-18 1:18.1.8-18+b1 Β· APACHE-2-LLVM-EXCEPTIONS
- ubuntu questing: lldb-18 1:18.1.8-18ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms