LLDB-SERVER(1)

πŸ“¦
version 19.1.7 Β· 5 versions
, in fedora 43

πŸ’– LLDB-SERVER(1) πŸ’–

okay bestie, welcome to the lldb-server page, straight out of the LLDB manual set ✨ this is the server-side bestie of the LLVM debugger and she is thriving.


🌈 NAME 🌈

lldb-server β€” LLDB Documentation πŸ“–


✨ SYNOPSIS ✨

lldb-server v[ersion]
lldb-server g[dbserver] [options]
lldb-server p[latform] [options]

πŸ¦‹ DESCRIPTION πŸ¦‹

so lldb-server is literally the server counterpart of the LLVM debugger, no cap. she runs and monitors the program being debugged while you, the user, interface with her through a client β€” either running locally or connecting remotely. it's giving long-distance relationship but make it debugging πŸ’…

okay so important legal lore: all of the code in the LLDB project is available under the Apache 2.0 License with LLVM exceptions. periodt.

πŸŽ€ COMMANDS πŸŽ€

the first argument to lldb-server specifies a command to run. like, pick your fighter:

  • v[ersion] β€” prints lldb-server version and exits. short and sweet, she said bye πŸ‘‹
  • g[dbserver] β€” runs the server using the gdb-remote protocol. LLDB can afterwards connect to the server using the gdb-remote command. iconic.
  • p[latform] β€” runs the platform server. LLDB can afterwards connect to the server using platform select, followed by platform connect. two-step slay ✨

🌸 GDBSERVER COMMAND 🌸

lldb-server g[dbserver] [options] [[host]:port] [[--] program args...]

πŸ’œ CONNECTION

  • host:port β€” specifies the hostname and TCP port to listen on. obligatory unless another listening option is used, bestie. if host is empty, localhost will be used. if port is zero, a random port will be selected, and written as specified by --pipe or --named-pipe options. surprise port, but make it documented 🎁
  • --fd <fd> β€” communicate over the given file descriptor instead of sockets.
  • --named-pipe <name> β€” write the listening port number to the specified named pipe.
  • --pipe <fd> β€” write the listening port number to the specified pipe (fd).
  • --reverse-connect β€” connect to the client instead of passively waiting for a connection. in this case, [host]:port denotes the remote address to connect to. she's making the first move, honestly relatable 🫢

πŸ’… GENERAL OPTIONS

  • --help β€” prints out the usage information and exits.
  • --log-channels <channel1 categories...:channel2 categories...> β€” channels to log. a colon-separated list of entries. each entry starts with a channel followed by a space-separated list of categories.
  • --log-file <file> β€” destination file to log to. if empty, log to stderr.
  • --setsid β€” run lldb-server in a new session. new session, new me 🌈

πŸ‘‘ TARGET SELECTION

  • --attach <pid-or-name> β€” attach to the process given by a (numeric) process id or a name.
  • -- program args β€” launch a program for debugging.

if neither of target options are used, lldb-server is started without a specific target. it can be afterwards instructed by the client to launch or attach. she's flexible like that ✨


🧚 PLATFORM COMMAND 🧚

lldb-server p[latform] [options] --server --listen [[host]:port]

πŸ’œ CONNECTION

  • --server β€” run in server mode, handling multiple connections. if this is not specified, lldb-server will accept only one connection and exit when it is finished. one-and-done energy vs. main character with a whole social calendar, your choice πŸŽ€
  • --listen <host>:<port> β€” hostname and port to listen on. obligatory. if port is zero, a random port will be used.
  • --socket-file <path> β€” write the listening socket port number to the specified file.

πŸ’… GENERAL OPTIONS

  • --log-channels <channel1 categories...:channel2 categories...> β€” channels to log. a colon-separated list of entries. each entry starts with a channel followed by a space-separated list of categories.
  • --log-file <file> β€” destination file to log to. if empty, log to stderr.

πŸ”₯ GDB-SERVER CONNECTIONS

  • --gdbserver-port <port> β€” define a port to be used for gdb-server connections. can be specified multiple times to allow multiple ports. has no effect if --min-gdbserver-port and --max-gdbserver-port are specified. (so those two just override her, rude but valid)
  • --min-gdbserver-port <port>
  • --max-gdbserver-port <port> β€” specify the range of ports that can be used for gdb-server connections. both options need to be specified simultaneously. overrides --gdbserver-port.
  • --port-offset <offset> β€” add the specified offset to port numbers returned by server. this is useful if the server is running behind a firewall, and a range of ports is redirected to it with an offset. firewall girlies rise up πŸ”₯

🌟 EXAMPLES 🌟

the server can be started in several modes, and honestly each one is a vibe.

in order to launch a new process inside the debugger, pass the path to it and the arguments to the debugged executable as positional arguments. to disambiguate between arguments passed to lldb and arguments passed to the debugged executable, arguments starting with a - must be passed after --. the server will launch the new executable and stop it immediately, waiting for the client to connect. so dramatic, she's literally holding the door open for you πŸ’…

lldb-server g :1234 /path/to/program program-argument -- --program-option

for convenience, passing the executable after -- is also supported.

lldb-server g :1234 -- /path/to/program program-argument --program-option

in order to attach to a running process, pass --attach along with the process identifier or name. the process will be stopped immediately after starting the server. note that terminating the server will usually cause the process to be detached and continue execution.

lldb-server g :1234 --attach 12345 lldb-server g :1234 --attach program-name

use gdb-remote command to connect to the server:

(lldb) gdb-remote 1234

lldb-server can also be started without an inferior. in this case, the client can select the target after connecting to the server. note that some commands (e.g. target create) will disconnect and launch a local lldb-server instead. she said "not me being replaced by a local" 😭

lldb-server g :1234

(lldb) gdb-remote 1234 (lldb) process launch a.out

πŸ”— SEE ALSO πŸ”—

the LLDB project page https://lldb.llvm.org has many different resources for lldb-server users. go read, bestie, iykyk πŸ“š


✍️ AUTHOR ✍️

LLVM project 🫢


2007-2026, The LLDB Team


and that's the whole page, angel πŸ’œ this was LLDB-SERVER(1) from the LLDB manual set, page 19, dated Mar 11, 2026 β€” version 19 energy, still slaying. go debug something iconic, no cap. πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from