debugging C, Objective-C and C++
Current command abbreviations 'help command alias'
add-dsym -- ('target symbols add') Add a debug symbol file to one of the target's current modules by specifying a path to a debug symbols file, or using
the options to specify a module to download symbols for.
bt -- ('_regexp-bt') Show a backtrace. An optional argument is accepted; if that argument is a number, it specifies the number of frames to
display. If that argument is 'all', full backtraces of all threads are displayed.
c -- ('process continue') Continue execution of all threads in the current process.
di -- ('disassemble') Disassemble bytes in the current function, or elsewhere in the executable program as specified by the user.
display -- ('_regexp-display') Add an expression evaluation stop-hook.
env -- ('_regexp-env') Implements a shortcut to viewing and setting environment variables.
f -- ('frame select') Select a frame by index from within the current thread and make it the current frame.
file -- ('target create') Create a target using the argument as the main executable.
finish -- ('thread step-out') Finish executing the function of the currently selected frame and return to its call site in specified thread (current
thread, if none specified).
image -- ('target modules') commands for accessing information for one or more target modules.
j -- ('_regexp-jump') Sets the program counter to a new address.
l -- ('_regexp-list') Implements the GDB 'list' command in all of its forms except FILE:FUNCTION and maps them to the appropriate 'source list'
n -- ('thread step-over') Source level single step in specified thread (current thread, if none specified), stepping over calls.
s -- ('thread step-in') Source level single step in specified thread (current thread, if none specified).
ni -- ('thread step-inst-over') Single step one instruction in specified thread (current thread, if none specified), stepping over calls.
si -- ('thread step-inst') Single step one instruction in specified thread (current thread, if none specified).
call -- ('expression --') Evaluate an expression (ObjC++ or Swift) in the current program context, using user defined variables and variables
currently in scope.
po -- ('expression -O -- ') Evaluate an expression (ObjC++ or Swift) in the current program context, using user defined variables and variables
currently in scope.
r -- ('process launch -X true --') Launch the executable in the debugger.
b -- ('_regexp-break') Set a breakpoint using a regular expression to specify the location, where
| list commands related to a word/subject.
| Also see _regexp-break.
| managing or customizing
| Evaluate an expression (ObjC++ or Swift) in the current program context, using user defined variables and variables currently in scope.
| operating on the current thread's frames.
| managing language-specific functionality.'.
| operating on logs.
| operating on memory.
| operating on watchpoints.
| operating on a process.
| managing or customizing plugin commands.
| commands to access thread registers.
| accessing source file information
| operating on debugger targets.
| operating on one or more threads within a running process.
| operating on the type system
| Pass an expression to the script interpreter for evaluation and return the results.
Drop into the interactive interpreter if no expression is given.
| manipulating internal settable debugger variables.
| manage and create platforms.
| Connect to a remote GDB server. If no hostname is provided, localhost is assumed.
| Connect to a remote KDP server. udp port 41139 is the default port number.
| creating domain specific bugreports.
| Switch into the curses based GUI mode.
| Show a list of all debugger commands, or give details about specific commands.
| Show version of LLDB debugger.
| Quit out of the LLDB debugger.
linenum is in decimal and
address is in hex.
rbreak -- ('breakpoint set -r %1') Sets a breakpoint or set of breakpoints in the executable.
repl -- ('expression -r -- ') Evaluate an expression (ObjC++ or Swift) in the current program context, using user defined variables and variables
currently in scope.
t -- ('thread select') Select a thread as the currently active thread.
tbreak -- ('_regexp-tbreak') Set a one shot breakpoint using a regular expression to specify the location, where
linenum is in decimal and
is in hex.
undisplay -- ('_regexp-undisplay') Remove an expression evaluation stop-hook.
up -- ('_regexp-up') Go up "n" frames in the stack (1 frame by default).
down -- ('_regexp-down') Go down "n" frames in the stack (1 frame by default).
x -- ('memory read') Read from the memory of the process being debugged.
attach -- ('_regexp-attach') Attach to a process id if in decimal, otherwise treat the argument as a process name to attach to.
detach -- ('process detach') Detach from the current process being debugged.
kill -- ('process kill') Terminate the current process being debugged.
continue -- ('process continue') Continue execution of all threads in the current process.
q -- ('quit') Quit out of the LLDB debugger.
For more information on any command, type
lldb -- The debugger
lldb [-hvdexw] [-a arch] [-c core-file] [-l script-language] [-s lldb-commands] [-n process-name] [-p pid] [[--]
lldb is the command line interface for the LLDB debugger library. lldb can debug C, C++, Objective-C, Objective-C++ and Swift programs.
a help command which can be used to find descriptions and examples of all lldb commands. For help on "breakpoint
set" type "help breakpoint set".
| usage information. --help is more up-to-date and authoritative than this.
| Prints out the version number of the lldb debugger.
which architecture to use when launching the specified program (if the executable is built for multiple architectures.)
| executable file to be launched / attach to.
| a currently-running process to attach to. (or the name of a process to wait for if -w is used.)
| with -n wait for a new process of that name to be started -- and attach to it as early in the process-launch as possible.
| a currently running process to attach to.
| the core file to examine.
use the specified scripting language for user-defined scripts, rather than the default. Valid scripting
languages that can be specified include Python, Perl, Ruby and Tcl. Currently only the Python extensions have been implemented.
| read in and execute the file "filename", which should contain lldb commands.
| Instructs lldb to open source files using the host's "external editor" mechanism.
| print out extra information for debugging itself.
| Do not automatically parse any '.lldbinit' files.
(If you do not provide -f then the first argument will be the file to be debugged so 'lldb -- [ ]' also
works. Remember to end the options with "--" if any of your arguments have a "-" in them.)
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 com-
mand by topic. For instance, "apropos breakpoint" will list any command that has the word "breakpoint" in its help text.
lldb will read settings/aliases/commands at startup,
~/.lldbinit-debugger . If you are using the lldb command line interface, this is ~/.lldbinit-lldb. If
you are using lldb inside a GUI debugger like Xcode this will be ~/.lldbinit-Xcode. This is a useful place to put settings that you want
to apply only when a given lldb command interpreter is used.
.lldbinit in the current working directory (where lldb is started) will be read.
The LLDB project page http://lldb.llvm.org/ has many different resources for lldb users - the gdb/lldb command equivalence page
http://lldb.llvm.org/lldb-gdb.html can be especially helpful for users coming from gdb.
To report bugs, please visit http://llvm.org/bugs/
Maintained by the LLDB Team, http://lldb.llvm.org/