LLDB-SERVER(1)

πŸ“¦ version 23.1.3, in centos-stream 9

πŸ’… lldb-server β€” the LLDB manual, but make it bestie-friendly

okay so this is the lldb-server page from the LLDB manual β€” yeah, LLDB Documentation, that's the one. sit down, grab a boba, we're learning ✨


🌸 SYNOPSIS 🌸

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

πŸ’– DESCRIPTION πŸ’–

so lldb-server is literally the server half of the LLVM debugger 🫢 it's the one doing the actual work β€” running and monitoring the program being debugged β€” while you, the main character, sit on the client side talking to it. client can be chillin' locally or connecting remotely, whatever vibes.

and good news for the lawyers in the chat: all of the code in the LLDB project is available under the Apache 2.0 License with LLVM exceptions. slay.


πŸ‘‘ COMMANDS πŸ‘‘

the first argument to lldb-server tells it which command to run. pick one:

  • v[ersion] β€” prints 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 it with the gdb-remote command. iconic.
  • p[latform] β€” runs the platform server. LLDB can then connect using platform select, followed by platform connect. the two-step combo, iykyk 🌈

πŸŽ€ GDBSERVER COMMAND πŸŽ€

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

πŸ”Œ CONNECTION πŸ”Œ

  • host:port β€” the hostname and TCP port to listen on. this one's obligatory unless you're using another listening option (no skipping, bestie). if host is empty, localhost gets used. if port is zero, a random port is selected and written out as specified by the --pipe or --named-pipe options. cute lil randomizer moment ✨
  • --fd <fd> β€” communicate over the given file descriptor instead of sockets. no socket, no problem.
  • --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 β€” flips the whole thing: connect to the client instead of passively waiting for a connection πŸ™ˆ in this case, [host]:port denotes the remote address to connect to.

βš™οΈ GENERAL OPTIONS βš™οΈ

  • --help β€” prints out the usage information and exits. the classic escape hatch.
  • --log-channels <channel1 categories...:channel2 categories...> β€” 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. yes, exactly like that, don't @ me.
  • --log-file <file> β€” destination file to log to. if it's empty, log to stderr.
  • --setsid β€” run lldb-server in a new session. fresh start energy 🌱

🎯 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 with no specific target. it can be instructed afterwards by the client to launch or attach. it's just vibing, waiting for direction πŸ’œ


πŸ¦‹ 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, no cap.
  • --listen <host>:<port> β€” hostname and port to listen on. obligatory (fr fr, you can't skip it). 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. colon-separated list of entries, each entry is a channel followed by a space-separated list of categories. same deal as before πŸ“
  • --log-file <file> β€” 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. multitasking queen πŸ‘‘

🌟 EXAMPLES 🌟

the server can be started in several modes, so let's run through them πŸ’–

launching a new process inside the debugger β€” pass the path to it and the args 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. so polite of it 🫢

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

attaching to a running process β€” pass --attach along with the process identifier or name. the process gets stopped immediately after starting the server. πŸ‘€ note: terminating the server will usually cause the process to be detached and continue execution. so like, don't be surprised when it keeps going after you dip.

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

connecting to the server β€” use the gdb-remote command:

(lldb) gdb-remote 1234

starting with no inferior at all β€” lldb-server can also be started without one. in that case the client can select the target after connecting to the server. πŸ™ˆ but heads up: some commands (e.g. target create) will disconnect and launch a local lldb-server instead. plot twist.

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

🌈 SEE ALSO 🌈

the LLDB project page https://lldb.llvm.org has so many different resources for lldb-server users. go browse, bestie, it's giving library πŸ’…


πŸ’œ AUTHOR πŸ’œ

LLVM project β€” yeah, the whole LLVM project. collective slay.

2007-2026, The LLDB Team


okay that's the whole page, you're officially educated 🧚 and yeah β€” the footer says this was the 23rd entry of the LLDB manual, dated Oct 06, 2026, so go forth, debug your little heart out, and remember: every server deserves a client that texts back πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from