LLDB - Execution Commands

Launch a process no arguments.

(lldb) process launch
(lldb) run
(lldb)

Launch a process with arguments <args>.

(lldb) process launch -- <args>
(lldb) r <args> 

Launch a process for with arguments a.out 1 2 3 without having to supply the args every time.

% lldb -- a.out 1 2 3
(lldb) run
...
(lldb) run
...

Set environment variables for process before launching.

(lldb) settings set target.env-vars DEBUG=1
(lldb) set se target.env-vars DEBUG=1
(lldb) env DEBUG=1

Set environment variables for process and launch process in one command.

(lldb) process launch -v DEBUG=1

Attach to a process with process ID 123.

(lldb) process attach --pid 123
(lldb) attach -p 123 

Attach to a process named "a.out".

(lldb) process attach --name a.out
(lldb) pro at -n a.out 

Wait for a process named "a.out" to launch and attach.

(lldb) process attach --name a.out --waitfor
(lldb) pro at -n a.out -w 

Attach to a remote gdb protocol server running on system "eorgadd", port 8000.

(lldb) gdb-remote eorgadd:8000 

Attach to a remote gdb protocol server running on the local system, port 8000.

(lldb) gdb-remote 8000

Attach to a Darwin kernel in kdp mode on system "eorgadd".

(lldb) kdp-remote eorgadd 

Do a source level single step in the currently selected thread.

(lldb) thread step-in
(lldb) step
(lldb)

Do a source level single step over in the currently selected thread.

(lldb) thread step-over
(lldb) next
(lldb) n

Do an instruction level single step in the currently selected thread.

(lldb) thread step-inst
(lldb) si

Do an instruction level single step over in the currently selected thread.

(lldb) thread step-inst-over
(lldb) ni 

Step out of the currently selected frame.

(lldb) thread step-out
(lldb) finish