LLDB - Examining thread state

Show the stack backtrace for the current thread.

(lldb) thread backtrace
(lldb) bt

Show the stack backtraces for all threads.

(lldb) thread backtrace all
(lldb) bt all 

Backtrace the first five frames of the current thread.

(lldb) thread backtrace -c 5
(lldb) bt 5 (lldb-169 and later)
(lldb) bt -c 5 (lldb-168 and earlier

Select a different stack frame by index for the current thread.

(lldb) frame select 12
(lldb) fr s 12
(lldb) f 12

List information about the currently selected frame in the current thread.

(lldb) frame info

Select the stack frame that called the current stack frame.

(lldb) up
(lldb) frame select --relative=1

Select the stack frame that is called by the current stack frame.

(lldb) down
(lldb) frame select --relative=-1
(lldb) fr s -r-1

Select a different stack frame using a relative offset.

(lldb) frame select --relative 2
(lldb) fr s -r2

(lldb) frame select --relative -3
(lldb) fr s -r-3

Show the general purpose registers for the current thread.

(lldb) register read

Write a new decimal value '123' to the current thread register 'rax'.

(lldb) register write rax 123

Disassemble the current function for the current frame.

(lldb) disassemble --frame
(lldb) di -f 

Disassemble any functions named main.

(lldb) disassemble --name main
(lldb) di -n main