LLDB-SERVER(1)

πŸ“¦
version 22.1.8 Β· 3 versions
, in fedora 44

πŸŽ€ LLDB-SERVER(1) πŸŽ€

bestie. sit down. we're talking about lldb-server, and it's literally the whole manual for it, from the LLDB docs. this is the server half of the LLVM debugger and it's genuinely iconic, no cap πŸ’…


🌸 NAME 🌸

lldb-server β€” LLDB Documentation 🫢


✨ SYNOPSIS ✨

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

πŸ’– DESCRIPTION πŸ’–

okay so lldb-server is the server counterpart of the LLVM debugger. the server is the one running and monitoring the debugged program (main character energy, honestly), while you interface with it via a client β€” either one running locally, or one connecting remotely. two halves of one slay.

also, 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. that's the vibe check β€” first thing you say decides everything.

  • v[ersion] β€” prints lldb-server version and exits. short, sweet, gone. πŸ’¨
  • g[dbserver] β€” runs the server using the gdb-remote protocol. LLDB can afterwards connect to the server using the gdb-remote command.
  • p[latform] β€” runs the platform server. LLDB can afterwards connect to the server using platform select, followed by platform connect.

πŸ¦‹ 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. if host is empty, localhost will be used. if port is zero, a random port will be selected, and written as specified by the --pipe or --named-pipe options.
  • --fd <fd> β€” communicate over the given file descriptor instead of sockets. not me avoiding the network entirely πŸ’€
  • --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 not waiting to be picked, she's picking πŸ”₯

🌟 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.

πŸ’œ 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 the target options are used, lldb-server is started without a specific target. it can be afterwards instructed by the client to launch or attach. lowkey mysterious of her πŸ™ˆ


πŸ“ 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 vs. here-for-the-whole-party energy.
  • --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. this port is used for multiple connections.

⭐ EXAMPLES ⭐

the server can be started in several modes. pick your fighter 🫢

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.

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. sneaky. she's got a mind of her own 😭

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 lurk, bestie, it's worth it πŸ¦‹


🌸 Author 🌸

LLVM project πŸ‘‘


2007-2026, The LLDB Team


and that's the whole thing, fr fr. this page is from the LLDB docs β€” LLDB-SERVER(1) β€” dated Jul 16, 2026. that's the entire read, you ate it, go forth and debug πŸ’…βœ¨πŸ’–

πŸ“¦ where this page comes from