LinuxCommandLibrary

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.

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.
--help
Display help information.

CAVEATS

Requires debug symbols. Different commands than gdb. Part of LLVM toolchain.

HISTORY

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

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community