20.4 Remote Configuration
This section documents the configuration options available when debugging remote programs. For the options related to the File I/O extensions of the remote protocol, see system-call-allowed.
- Set the maximum size of address in a memory packet to the specified
number of bits. gdb will mask off the address bits above
that number, when it passes addresses to the remote target. The
default value is the number of bits in the target's address.
- Show the current value of remote address size in bits.
- Set the baud rate for the remote serial I/O to n baud. The
value is used to set the speed of the serial port used for debugging
- Show the current speed of the remote connection.
If set to on, gdb sends a
BREAKsignal to the remote when you type Ctrl-c to interrupt the program running on the remote. If set to off, gdb sends the Ctrl-C character instead. The default is off, since most remote systems expect to see Ctrl-C as the interrupt signal.
- Show whether gdb sends
BREAKor Ctrl-C to interrupt the remote program.
set remoteflow on
set remoteflow off
- Enable or disable hardware flow control (
CTS) on the serial port used to communicate to the remote target.
- Show the current setting of hardware flow control.
- Set the base (a.k.a. radix) of logging serial protocol
communications to base. Supported values of base are:
hex. The default is
- Show the current setting of the radix for logging remote serial
- Record remote serial communications on the named file. The
default is not to record at all.
- Show the current setting of the file name on which to record the
- Set the timeout limit to wait for the remote target to respond to
num seconds. The default is 2 seconds.
- Show the current number of seconds to wait for the remote target responses.
set remote hardware-watchpoint-limitlimit
set remote hardware-breakpoint-limitlimit
- Restrict gdb to using limit remote hardware breakpoint or
watchpoints. A limit of -1, the default, is treated as unlimited.
set remote exec-filefilename
show remote exec-file
Select the file used for
target extended-remote. This should be set to a filename valid on the target system. If it is not set, the target will use a default filename (e.g. the last program run).
set remote interrupt-sequence
- Allow the user to select one of Ctrl-C, a
BREAKor BREAK-g as the sequence to the remote target in order to interrupt the execution. Ctrl-C is a default. Some system prefers
BREAKwhich is high level of serial line for some certain time. Linux kernel prefers BREAK-g, a.k.a Magic SysRq g. It is
BREAKsignal followed by character
- Show which of Ctrl-C,
BREAK-gis sent by gdb to interrupt the remote program.
BREAK-gis BREAK signal followed by
gand also known as Magic SysRq g.
set remote interrupt-on-connect
- Specify whether interrupt-sequence is sent to remote target when
gdb connects to it. This is mostly needed when you debug
Linux kernel. Linux kernel expects
gwhich is known as Magic SysRq g in order to connect gdb.
- Show whether interrupt-sequence is sent to remote target when gdb connects to it.
set tcp auto-retry on
- Enable auto-retry for remote TCP connections. This is useful if the remote
debugging agent is launched in parallel with gdb; there is a race
condition because the agent may not become ready to accept the connection
before gdb attempts to connect. When auto-retry is
enabled, if the initial attempt to connect fails, gdb reattempts
to establish the connection using the timeout specified by
set tcp connect-timeout.
set tcp auto-retry off
- Do not auto-retry failed TCP connections.
show tcp auto-retry
- Show the current auto-retry setting.
set tcp connect-timeoutseconds
- Set the timeout for establishing a TCP connection to the remote target to
seconds. The timeout affects both polling to retry failed connections
set tcp auto-retry on) and waiting for connections that are merely slow to complete, and represents an approximate cumulative value.
show tcp connect-timeout
- Show the current connection timeout setting.
The gdb remote protocol autodetects the packets supported by your debugging stub. If you need to override the autodetection, you can use these commands to enable or disable individual packets. Each packet can be set to on (the remote target supports this packet), off (the remote target does not support this packet), or auto (detect remote target support for this packet). They all default to auto. For more information about each packet, see Remote Protocol.
During normal use, you should not have to use any of these commands. If you do, that may be a bug in your remote debugging stub, or a bug in gdb. You may want to report the problem to the gdb developers.
For each packet name, the command to enable or disable the
set remote name
-packet. The available settings
|Command Name||Remote Packet||Related Features
|Detecting multiple threads
|Stepping or resuming multiple threads
|Display MS-Windows Thread Information Block.
|Remote communications parameters
|Querying remote process attach state.