expression, e, print, p, po
(lldb) print ... = (lldb) p ... = (lldb) expression -- ... = (lldb) e -- ...
Evaluate an expression on the current thread. Display any returned value with LLDB defalt formating.
- Usage
- (lldb) e
- (lldb) expression
- Flags
- -D (--depth ) — Set the max recurse depth when dumping aggregate types (default is infinity).
- -O (--object-description) — Display using a language-specific description API, if possible.
- -T (--show-types) — Show variable types when dumping values.
- -f (--format ) –– Specify a format to be used for display.
- -i (--ignore-breakpoints ) — Ignore breakpoint hits while running expressions
- Help
- (lldb) help # To explore all available commands
- (lldb) help expression # To explore all expressions related sub-commands
- Example
- (lldb) e -D 1 -- self
- (lldb) e -D 1 -i false -- someMethod()
- bugreport
- Report full current app's state
- frame
- Quick overview stack frame in current thread.
process, breakpoint, thread
- process: control debug process
The following subcommands are supported:
attach -- Attach to a process.
connect -- Connect to a remote debug service.
continue -- Continue execution of all threads in the current process.
detach -- Detach from the current target process.
handle -- Manage LLDB handling of OS signals for the current target
process. Defaults to showing current policy.
interrupt -- Interrupt the current target process.
kill -- Terminate the current target process.
launch -- Launch the executable in the debugger.
load -- Load a shared library into the current process.
plugin -- Send a custom command to the current target process plug-in.
save-core -- Save the current process as a core file using an appropriate
file type.
signal -- Send a UNIX signal to the current target process.
status -- Show status and stop location for the current target process.
unload -- Unload a shared library from the current process using the
index returned by a previous call to "process load".
- breakpoint
- breakpoint list
- breakpoint set -f ViewController.swift -l 96
- b ViewController.swift:96 // Short version of the command above
- breakpoint set --func-regex valueOfLifeWithoutSumOf
- b -r valueOfLifeWithoutSumOf // Short version of the command above
- breakpoint set --one-shot -f ViewController.swift -l 90
- br s -o -f ViewController.swift -l 91 // Shorter version of the command above
- breakpoint command list 2
- thread
- (lldb) thread step-over
- (lldb) next // The same as "thread step-over" command
- (lldb) n // The same as "next" command
- (lldb) thread step-in
- (lldb) step // The same as "thread step-in"
- (lldb) s // The same as "step"
command, platform, gui
- command import ~/Desktop/script.py
import lldb
def print_hello(debugger, command, result, internal_dict):
print "Hello Debugger!"
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f script.print_hello print_hello') // Handle script initialization and add command from this module
print 'The "print_hello" python command has been installed and is ready for use.' // Print confirmation that everything works
- platform status
- gui