Home / Programming /
swift build -c debug -Xswiftc -glldb ./path/to/exe
swift build followed by lldb .build/debug/<your exe name>lldb .build/debug/<YourPackageName>PackageTests.xctestbreakpoint set --file FileName.swift --line 42runLaunch LLDB with an executable:
lldb ./executableAttach to a running process by PID:
lldb -p <pid>lldb --attach-name <process-name>Run the program:
run or rContinue execution:
continue or cStep over:
next or nStep into:
step or sfinishSet a breakpoint by line number:
breakpoint set --file <file> --line <line-number>Set a breakpoint by function name:
breakpoint set --name <function-name>List all breakpoints:
breakpoint listbreakpoint delete <breakpoint-id>Print variable value:
print <variable-name> or p <variable-name>Examine memory:
memory read <address>Backtrace (stack trace):
bt or thread backtraceList local variables:
frame variable or fr vframe variable -f hex <variable-name> or p/x <variable-name>expr <variable-name> = <value>List source code:
listdisassemble or disquit or exit.lldbinit file:
this document last modified: October 12 2024 18:42
Home / Programming /