OS Manuals

/usr/bin/gdbserver

The GNU Debugger (multiarch)

From gdb-multiarch 18.1-r0 (os), captured 2026-11-05 by running gdbserver --help (exit 0). permalink

Usage:	gdbserver [OPTIONS] COMM PROG [ARGS ...]
	gdbserver [OPTIONS] --attach COMM PID
	gdbserver [OPTIONS] --multi COMM

COMM may either be a tty device (for serial debugging),
HOST:PORT to listen for a TCP connection, or '-' or 'stdio' to use
stdin/stdout of gdbserver.
PROG is the executable program.  ARGS are arguments passed to inferior.
PID is the process ID to attach to, when --attach is specified.

Operating modes:

  --attach              Attach to running process PID.
  --multi               Start server without a specific program, and
                        only quit when explicitly commanded.
  --once                Exit after the first connection has closed.
  --help                Print this message and then exit.
  --version             Display version information and exit.

Other options:

  --wrapper WRAPPER --  Run WRAPPER to start new programs.
  --disable-randomization
                        Run PROG with address space randomization disabled.
  --no-disable-randomization
                        Don't disable address space randomization when
                        starting PROG.
  --startup-with-shell
                        Start PROG using a shell.  I.e., execs a shell that
                        then execs PROG.  (default)
                        To make use of globbing and variable substitution for
                        arguments passed directly on gdbserver invocation,
                        see the --no-escape-args command line option in
                        addition
  --no-startup-with-shell
                        Exec PROG directly instead of using a shell.
  --no-escape-args
                        If PROG is started using a shell (see the
                        --[no-]startup-with-shell option),
                        ARGS passed directly on gdbserver invocation are
                        escaped, so no globbing or variable substitution
                        happens for those. This option disables escaping, so
                        globbing and variable substitution in the shell
                        are done for ARGS on UNIX-like systems.

Debug options:

  --debug[=OPT1,OPT2,...]
                        Enable debugging output.
                          Options:
                            all, threads, event-loop, remote
                          With no options, 'threads' is assumed.
                          Prefix an option with '-' to disable
                          debugging of that component.
  --debug-format=OPT1[,OPT2,...]
                        Specify extra content in debugging output.
                          Options:
                            all
                            none
                            timestamp
  --disable-packet=OPT1[,OPT2,...]
                        Disable support for RSP packets or features.
                          Options:
                            vCont, vConts, T, Tthread, qC, qfThreadInfo and
                            threads (disable all threading packets).

For more information, consult the GDB manual (available as on-line
info or a printed manual).
Report bugs to "<http://www.gnu.org/software/gdb/bugs/>".
Options (15)
OptionDescriptionSource
--attachgdbserver will attach to a running program.help + man
--multiTo start "gdbserver" without supplying an initial command to run or process ID to attach, use this command line option.help + man
--onceBy default, gdbserver keeps the listening TCP port open, so that additional connections are possible.help + man
--helpList all options, with brief explanations.help + man
--versionThis option causes gdbserver to print its version number and exit.help + man
--wrapper WRAPPERSpecify a wrapper to launch programs for debugging.help + man
--disable-randomizationRun PROG with address space randomization disabled.help
--no-disable-randomizationDon't disable address space randomization when starting PROG.help
--startup-with-shellStart PROG using a shell.help
--no-startup-with-shellExec PROG directly instead of using a shell.help
--no-escape-argsBy default, inferior arguments passed on the gdbserver command line will have any special shell characters escaped by gdbserver.help + man
--debug OPT1Enable debugging output.help
--debug-format OPT1Specify extra content in debugging output.help
--disable-packet OPT1Disable support for RSP packets or features.help
--debug-file filenameInstruct "gdbserver" to send any debug output to the given filename. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.