Next: , Previous: Server, Up: Remote Debugging   [Contents][Index]


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 remoteaddresssize bits

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 remoteaddresssize

Show the current value of remote address size in bits.

set serial baud n

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 remote targets.

show serial baud

Show the current speed of the remote connection.

set serial parity parity

Set the parity for the remote serial I/O. Supported values of parity are: even, none, and odd. The default is none.

show serial parity

Show the current parity of the serial port.

set remotebreak

If set to on, GDB sends a BREAK signal 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 remotebreak

Show whether GDB sends BREAK or ‘Ctrl-C’ to interrupt the remote program.

set remoteflow on
set remoteflow off

Enable or disable hardware flow control (RTS/CTS) on the serial port used to communicate to the remote target.

show remoteflow

Show the current setting of hardware flow control.

set remotelogbase base

Set the base (a.k.a. radix) of logging serial protocol communications to base. Supported values of base are: ascii, octal, and hex. The default is ascii.

show remotelogbase

Show the current setting of the radix for logging remote serial protocol.

set remotelogfile file

Record remote serial communications on the named file. The default is not to record at all.

show remotelogfile

Show the current setting of the file name on which to record the serial communications.

set remotetimeout num

Set the timeout limit to wait for the remote target to respond to num seconds. The default is 2 seconds.

show remotetimeout

Show the current number of seconds to wait for the remote target responses.

set remote hardware-watchpoint-limit limit
set remote hardware-breakpoint-limit limit

Restrict GDB to using limit remote hardware watchpoints or breakpoints. The limit can be set to 0 to disable hardware watchpoints or breakpoints, and unlimited for unlimited watchpoints or breakpoints.

show remote hardware-watchpoint-limit
show remote hardware-breakpoint-limit

Show the current limit for the number of hardware watchpoints or breakpoints that GDB can use.

set remote hardware-watchpoint-length-limit limit

Restrict GDB to using limit bytes for the maximum length of a remote hardware watchpoint. A limit of 0 disables hardware watchpoints and unlimited allows watchpoints of any length.

show remote hardware-watchpoint-length-limit

Show the current limit (in bytes) of the maximum length of a remote hardware watchpoint.

set remote exec-file filename
show remote exec-file

Select the file used for run with 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 BREAK or ‘BREAK-g’ as the sequence to the remote target in order to interrupt the execution. ‘Ctrl-C’ is a default. Some system prefers BREAK which is high level of serial line for some certain time. Linux kernel prefers ‘BREAK-g’, a.k.a Magic SysRq g. It is BREAK signal followed by character g.

show interrupt-sequence

Show which of ‘Ctrl-C’, BREAK or BREAK-g is sent by GDB to interrupt the remote program. BREAK-g is BREAK signal followed by g and 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 BREAK followed by g which is known as Magic SysRq g in order to connect GDB.

show interrupt-on-connect

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-timeout seconds
set tcp connect-timeout unlimited

Set the timeout for establishing a TCP connection to the remote target to seconds. The timeout affects both polling to retry failed connections (enabled by set tcp auto-retry on) and waiting for connections that are merely slow to complete, and represents an approximate cumulative value. If seconds is unlimited, there is no timeout and GDB will keep attempting to establish a connection forever, unless interrupted with Ctrl-c. The default is 15 seconds.

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 packet is set remote name-packet. The available settings are:

Command NameRemote PacketRelated Features
fetch-registerpinfo registers
set-registerPset
binary-downloadXload, set
read-aux-vectorqXfer:auxv:readinfo auxv
symbol-lookupqSymbolDetecting multiple threads
attachvAttachattach
verbose-resumevContStepping or resuming multiple threads
runvRunrun
software-breakpointZ0break
hardware-breakpointZ1hbreak
write-watchpointZ2watch
read-watchpointZ3rwatch
access-watchpointZ4awatch
pid-to-exec-fileqXfer:exec-file:readattach, run
target-featuresqXfer:features:readset architecture
library-infoqXfer:libraries:readinfo sharedlibrary
memory-mapqXfer:memory-map:readinfo mem
read-sdata-objectqXfer:sdata:readprint $_sdata
read-siginfo-objectqXfer:siginfo:readprint $_siginfo
write-siginfo-objectqXfer:siginfo:writeset $_siginfo
threadsqXfer:threads:readinfo threads
get-thread-local-
storage-address
qGetTLSAddrDisplaying __thread variables
get-thread-information-block-addressqGetTIBAddrDisplay MS-Windows Thread Information Block.
search-memoryqSearch:memoryfind
supported-packetsqSupportedRemote communications parameters
catch-syscallsQCatchSyscallscatch syscall
pass-signalsQPassSignalshandle signal
program-signalsQProgramSignalshandle signal
hostio-close-packetvFile:closeremote get, remote put
hostio-open-packetvFile:openremote get, remote put
hostio-pread-packetvFile:preadremote get, remote put
hostio-pwrite-packetvFile:pwriteremote get, remote put
hostio-unlink-packetvFile:unlinkremote delete
hostio-readlink-packetvFile:readlinkHost I/O
hostio-fstat-packetvFile:fstatHost I/O
hostio-setfs-packetvFile:setfsHost I/O
noack-packetQStartNoAckModePacket acknowledgment
osdataqXfer:osdata:readinfo os
query-attachedqAttachedQuerying remote process attach state.
trace-buffer-sizeQTBuffer:sizeset trace-buffer-size
trace-statusqTStatuststatus
traceframe-infoqXfer:traceframe-info:readTraceframe info
install-in-traceInstallInTraceInstall tracepoint in tracing
disable-randomizationQDisableRandomizationset disable-randomization
startup-with-shellQStartupWithShellset startup-with-shell
environment-hex-encodedQEnvironmentHexEncodedset environment
environment-unsetQEnvironmentUnsetunset environment
environment-resetQEnvironmentResetReset the inferior environment (i.e., unset user-set variables)
set-working-dirQSetWorkingDirset cwd
conditional-breakpoints-packetZ0 and Z1Support for target-side breakpoint condition evaluation
multiprocess-extensionsmultiprocess extensionsDebug multiple processes and remote process PID awareness
swbreak-featureswbreak stop reasonbreak
hwbreak-featurehwbreak stop reasonhbreak
fork-event-featurefork stop reasonfork
vfork-event-featurevfork stop reasonvfork
exec-event-featureexec stop reasonexec
thread-eventsQThreadEventsTracking thread lifetime.
no-resumed-stop-replyno resumed thread left stop replyTracking thread lifetime.

Next: , Previous: Server, Up: Remote Debugging   [Contents][Index]