LLDB-SERVER(1)

πŸ“¦
version 21.1.8 Β· 5 versions
, in fedora 44

πŸ’… lldb-server β€” the LLDB docs, bestie edition

okay so this is lldb-server(1), straight out of the LLDB manual, and i'm gonna walk you through it like we're texting at 2am 🫢 no cap, it's actually so good.


✨ NAME ✨

lldb-server β€” the server half of the LLVM debugger. literally the main character energy of remote debugging πŸŽ€


✨ SYNOPSIS ✨

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

✨ DESCRIPTION ✨

so lldb-server is the server counterpart of the LLVM debugger πŸ’– The server is the one that runs and monitors the debugged program, while you β€” the user β€” talk to it through a client. And that client can be running locally or connecting remotely. either way, she's serving.

ngl, the license situation is actually iconic: 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 tells it which command to run. like a vibe check, but for what she's about to do:

  • v[ersion] β€” prints the lldb-server version and then dips. that's it, that's the whole job πŸ’…
  • g[dbserver] β€” runs the server using the gdb-remote protocol. after that, LLDB can connect to the server using the gdb-remote command. slay.
  • p[latform] β€” runs the platform server. LLDB can then connect using platform select, followed by platform connect. yes bestie, in that order πŸ™ˆ

🌸 GDBSERVER COMMAND 🌸

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

πŸ”Œ CONNECTION

  • host:port β€” tells her the hostname and TCP port to listen on. This one is obligatory unless you're using another listening option. If host is empty, localhost gets used. If port is zero, a random port is selected, and it gets written out as specified by the --pipe or --named-pipe options. cute, right? πŸŽ€
  • --fd <fd> β€” communicate over the given file descriptor instead of sockets. no sockets, just vibes.
  • --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 β€” she connects to the client instead of passively waiting for a connection. in that case, [host]:port denotes the remote address to connect to. bold of her, honestly.

βš™οΈ GENERAL OPTIONS

  • --help β€” prints out the usage information and exits.
  • --log-channels <channel1 categories...:channel2 categories...> β€” the channels to log. It's a colon-separated list of entries, and each entry starts with a channel followed by a space-separated list of categories. iykyk πŸ’œ
  • --log-file <file> β€” the destination file to log to. If it's empty, log to stderr.
  • --setsid β€” run lldb-server in a new session. independent queen ✨

🎯 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 those target options is used, lldb-server starts up without a specific target. the client can then instruct it to launch or attach afterwards. no pressure, she's flexible.

πŸ¦‹ PLATFORM COMMAND πŸ¦‹

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

πŸ”Œ CONNECTION

  • --server β€” run in server mode, handling multiple connections. If you don't specify this, lldb-server will accept only one connection and exit when it's finished. one and done, diva behavior πŸ’…
  • --listen <host>:<port> β€” hostname and port to listen on. Obligatory. If the 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...> β€” the channels to log. Colon-separated list of entries; each entry starts with a channel followed by a space-separated list of categories. (yes it's the same as above, she's consistent πŸŽ€)
  • --log-file <file> β€” the destination file to log to. If it's 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. multi-tasking icon.

🌈 EXAMPLES 🌈

the server can be started in several modes. let's go through them, bestie:

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 launches the new executable and stops it immediately, waiting for the client to connect. πŸ’–

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

convenience alert β€” passing the executable after -- is also supported ✨

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

attach to a running process β€” pass --attach along with the process identifier or name. The process gets stopped immediately after starting the server. ⚠️ but note: terminating the server will usually cause the process to be detached and continue execution. so like, be aware.

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

connect to the server β€” use the gdb-remote command, obviously 😌

(lldb) gdb-remote 1234

no inferior, no problem β€” lldb-server can also be started without one. In that case, the client can select the target after connecting to the server. heads up though: some commands (e.g. target create) will disconnect and launch a local lldb-server instead πŸ™ˆ

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 look, it's giving library of alexandria but make it debugging πŸ’œ


πŸ“– Author

LLVM project πŸ‘‘

2007-2026, The LLDB Team


okay that's the whole page, no notes πŸ’… this was lldb-server(1) from the LLDB manual, version 21, dated May 15, 2026 β€” mwah, go debug something iconic, bestie πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from