LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lldb

LLVM debugger

TLDR

Debug executable
$ lldb [program]
copy
Debug with arguments
$ lldb -- [program] [arg1] [arg2]
copy
Attach to process
$ lldb -p [pid]
copy
Attach by name
$ lldb -n [process_name]
copy
Run commands on start
$ lldb -o "[breakpoint set -n main]" [program]
copy
Load core dump
$ lldb -c [core] [program]
copy

SYNOPSIS

lldb [options] [program] [-- args]

DESCRIPTION

lldb is the LLVM debugger. It debugs C, C++, Objective-C, and Swift programs.The tool provides breakpoints, watchpoints, stepping, and memory inspection. It's the default debugger on macOS and is part of the Xcode developer tools.

PARAMETERS

PROGRAM

Executable to debug.
-p PID
Attach to process by PID.
-n NAME
Attach to process by name.
-c CORE
Load core dump file.
-o CMD
Execute command on start.
-s FILE
Source commands from file after loading.
-O CMD
Execute command before loading the file.
-f FILE
Specify executable to debug.
-a ARCH
Specify architecture to use when launching the program.
-w
Wait for a process to launch with the name given by -n.
-x
Don't automatically parse .lldbinit files.
-h, --help
Display help information.
-v, --version
Display version information.

CAVEATS

Requires debug symbols (-g flag at compile time). Commands differ from gdb; see `lldb` `help` or the GDB-to-LLDB command map. Part of the LLVM toolchain.

HISTORY

LLDB was developed by Apple as part of LLVM, providing a modern debugger with modular architecture.

SEE ALSO

gdb(1), clang(1)

Copied to clipboard
Kai