LLDB-SERVER(1)
π₯οΈ NAME
lldb-server β the LLDB docs girlie herself π
okay so basically lldb-server is the server half of the LLVM debugger, and she's kind of the main character of this whole operation β¨
β¨ SYNOPSIS
lldb-server v[ersion]
lldb-server g[dbserver] [options]
lldb-server p[latform] [options]
π DESCRIPTION
lldb-server is the server counterpart of the LLVM debugger β like, the backstage bestie π«Ά. The server runs and monitors the debugged program, while you (the user) interface with it through a client, either running locally or connecting remotely. no cap, that's the whole vibe.
Also, PSA for the legal girlies: all of the code in the LLDB project is available under the Apache 2.0 License with LLVM exceptions πβ¨.
π COMMANDS
The first argument to lldb-server specifies a command to run. (first arg = which mode, iykyk)
v[ersion]β printslldb-serverversion and exits. that's it, that's the whole job πββοΈg[dbserver]β runs the server using the gdb-remote protocol. LLDB can afterwards connect to the server using thegdb-remotecommand π₯p[latform]β runs the platform server. LLDB can afterwards connect to the server usingplatform select, followed byplatform 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 (she needs somewhere to live, bestie). Ifhostis empty,localhostwill be used. Ifportis zero, a random port will be selected, and written as specified by--pipeor--named-pipeoptions π²--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]:portdenotes the remote address to connect to. she's making the first move π
βοΈ 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. (colon between entries, spaces inside each one β don't mix 'em up π)--log-file <file>β destination file to log to. If empty, log tostderr.--setsidβ runlldb-serverin 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 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 the most flexible option ngl
π 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-serverwill accept only one connection and exit when it is finished. one and done, bestie π--listen <host>:<port>β hostname and port to listen on. Obligatory. Ifportis 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 tostderr.
π§ 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. let's go through the whole aesthetic β¨
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 π (yep, she keeps running, so don't be surprised)
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 π
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 β β seriously, go lurk, it's giving resource hub.
π Author
LLVM project
Β©οΈ Copyright
2007-2026, The LLDB Team
and that's the whole page bestie π β brought to you by manpage version 23, dated Oct 20, 2026, straight from the LLDB-SERVER(1) files. periodt π
β¨
π¦ where this page comes from
- arch rolling: lldb 23.1.4-1 Β· Apache-2.0 WITH LLVM-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms