LLDB - Examining Variables

Show the arguments and local variables for the current frame.

(lldb) frame variable
(lldb) fr v

Show the local variables for the current frame.

(lldb) frame variable --no-args
(lldb) fr v -a

Show the contents of local variable "bar".

(lldb) frame variable bar
(lldb) fr v bar
(lldb) p bar 

Show the contents of local variable "bar" formatted as hex.

(lldb) frame variable --format x bar
(lldb) fr v -f x bar 

Show the contents of global variable "baz".

(lldb) target variable baz
(lldb) ta v baz 

Show the global/static variables defined in the current source file.

(lldb) target variable
(lldb) ta v 

Display a the variable "argc" and "argv" every time you stop.

(lldb) target stop-hook add --one-liner "frame variable argc argv"
(lldb) ta st a -o "fr v argc argv"
(lldb) display argc
(lldb) display argv

Display a the variable "argc" and "argv" only when you stop in the function named main.

(lldb) target stop-hook add --name main --one-liner "frame variable argc argv"
(lldb) ta st a -n main -o "fr v argc argv"

Display the variable "*this" only when you stop in c class named MyClass.

(lldb) target stop-hook add --classname MyClass --one-liner "frame variable *this"
(lldb) ta st a -c MyClass -o "fr v *this"