Remote Configuration (Debugging with GDB)
Next: Remote Stub, 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 bitsSet 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 remoteaddresssizeShow the current value of remote address size in bits.
set serial baud nSet the baud rate for the remote serial I/O to
nbaud. The value is used to set the speed of the serial port used for debugging remote targets.show serial baudShow the current speed of the remote connection.
set serial parity paritySet the parity for the remote serial I/O. Supported values of
parityare:even,none, andodd. The default isnone.show serial parityShow the current parity of the serial port.
set remotebreakIf 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 remotebreakShow whether GDB sends
BREAKor ‘Ctrl-C’ to interrupt the remote program.set remoteflow on
set remoteflow offEnable or disable hardware flow control (
RTS/CTS) on the serial port used to communicate to the remote target.show remoteflowShow the current setting of hardware flow control.
set remotelogbase baseSet the base (a.k.a. radix) of logging serial protocol communications to
base. Supported values ofbaseare:ascii,octal, andhex. The default isascii.show remotelogbaseShow the current setting of the radix for logging remote serial protocol.
set remotelogfile fileRecord remote serial communications on the named
file. The default is not to record at all.show remotelogfileShow the current setting of the file name on which to record the serial communications.
set remotetimeout numSet the timeout limit to wait for the remote target to respond to
numseconds. The default is 2 seconds.show remotetimeoutShow the current number of seconds to wait for the remote target responses.
set remote hardware-watchpoint-limit limit
set remote hardware-breakpoint-limit limitRestrict GDB to using
limitremote hardware watchpoints or breakpoints. Thelimitcan be set to 0 to disable hardware watchpoints or breakpoints, andunlimitedfor unlimited watchpoints or breakpoints.show remote hardware-watchpoint-limit
show remote hardware-breakpoint-limitShow the current limit for the number of hardware watchpoints or breakpoints that GDB can use.
set remote hardware-watchpoint-length-limit limitRestrict GDB to using
limitbytes for the maximum length of a remote hardware watchpoint. Alimitof 0 disables hardware watchpoints andunlimitedallows watchpoints of any length.show remote hardware-watchpoint-length-limitShow the current limit (in bytes) of the maximum length of a remote hardware watchpoint.
set remote exec-file filename
show remote exec-fileSelect the file used for
runwithtarget 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-sequenceAllow the user to select one of ‘
Ctrl-C’, aBREAKor ‘BREAK-g’ as the sequence to the remote target in order to interrupt the execution. ‘Ctrl-C’ is a default. Some system prefersBREAKwhich is high level of serial line for some certain time. Linux kernel prefers ‘BREAK-g’, a.k.a Magic SysRq g. It isBREAKsignal followed by characterg.show remote interrupt-sequenceShow which of ‘
Ctrl-C’,BREAKorBREAK-gis sent by GDB to interrupt the remote program.BREAK-gis BREAK signal followed bygand also known as Magic SysRq g.set remote interrupt-on-connectSpecify 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
BREAKfollowed bygwhich is known as Magic SysRq g in order to connect GDB.show remote interrupt-on-connectShow whether interrupt-sequence is sent to remote target when GDB connects to it.
set tcp auto-retry onEnable 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 offDo not auto-retry failed TCP connections.
show tcp auto-retryShow the current auto-retry setting.
set tcp connect-timeout seconds
set tcp connect-timeout unlimitedSet the timeout for establishing a TCP connection to the remote target to
seconds. The timeout affects both polling to retry failed connections (enabled byset tcp auto-retry on) and waiting for connections that are merely slow to complete, and represents an approximate cumulative value. Ifsecondsisunlimited, 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-timeoutShow 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 Name | Remote Packet | Related Features |
fetch-register
|
p
|
info registers
|
set-register
|
P
|
set
|
binary-download
|
X
|
load, set
|
read-aux-vector
|
qXfer:auxv:read
|
info auxv
|
symbol-lookup
|
qSymbol
|
Detecting multiple threads |
attach
|
vAttach
|
attach
|
verbose-resume
|
vCont
|
Stepping or resuming multiple threads |
run
|
vRun
|
run
|
software-breakpoint
|
Z0
|
break
|
hardware-breakpoint
|
Z1
|
hbreak
|
write-watchpoint
|
Z2
|
watch
|
read-watchpoint
|
Z3
|
rwatch
|
access-watchpoint
|
Z4
|
awatch
|
pid-to-exec-file
|
qXfer:exec-file:read
|
attach, run
|
target-features
|
qXfer:features:read
|
set architecture
|
library-info
|
qXfer:libraries:read
|
info sharedlibrary
|
memory-map
|
qXfer:memory-map:read
|
info mem
|
read-sdata-object
|
qXfer:sdata:read
|
print $_sdata
|
read-siginfo-object
|
qXfer:siginfo:read
|
print $_siginfo
|
write-siginfo-object
|
qXfer:siginfo:write
|
set $_siginfo
|
threads
|
qXfer:threads:read
|
info threads
|
get-thread-local-storage-address
|
qGetTLSAddr
|
Displaying __thread variables
|
get-thread-information-block-address
|
qGetTIBAddr
|
Display MS-Windows Thread Information Block. |
search-memory
|
qSearch:memory
|
find
|
supported-packets
|
qSupported
|
Remote communications parameters |
catch-syscalls
|
QCatchSyscalls
|
catch syscall
|
pass-signals
|
QPassSignals
|
handle signal
|
program-signals
|
QProgramSignals
|
handle signal
|
hostio-close-packet
|
vFile:close
|
remote get, remote put
|
hostio-open-packet
|
vFile:open
|
remote get, remote put
|
hostio-pread-packet
|
vFile:pread
|
remote get, remote put
|
hostio-pwrite-packet
|
vFile:pwrite
|
remote get, remote put
|
hostio-unlink-packet
|
vFile:unlink
|
remote delete
|
hostio-readlink-packet
|
vFile:readlink
|
Host I/O |
hostio-fstat-packet
|
vFile:fstat
|
Host I/O |
hostio-setfs-packet
|
vFile:setfs
|
Host I/O |
noack-packet
|
QStartNoAckMode
|
Packet acknowledgment |
osdata
|
qXfer:osdata:read
|
info os
|
query-attached
|
qAttached
|
Querying remote process attach state. |
trace-buffer-size
|
QTBuffer:size
|
set trace-buffer-size
|
trace-status
|
qTStatus
|
tstatus
|
traceframe-info
|
qXfer:traceframe-info:read
|
Traceframe info |
install-in-trace
|
InstallInTrace
|
Install tracepoint in tracing |
disable-randomization
|
QDisableRandomization
|
set disable-randomization
|
startup-with-shell
|
QStartupWithShell
|
set startup-with-shell
|
environment-hex-encoded
|
QEnvironmentHexEncoded
|
set environment
|
environment-unset
|
QEnvironmentUnset
|
unset environment
|
environment-reset
|
QEnvironmentReset
|
Reset the inferior environment (i.e., unset user-set variables)
|
set-working-dir
|
QSetWorkingDir
|
set cwd
|
conditional-breakpoints-packet
|
Z0 and Z1
|
Support for target-side breakpoint condition evaluation
|
multiprocess-extensions
|
multiprocess extensions
|
Debug multiple processes and remote process PID awareness |
swbreak-feature
|
swbreak stop reason
|
break
|
hwbreak-feature
|
hwbreak stop reason
|
hbreak
|
fork-event-feature
|
fork stop reason
|
fork
|
vfork-event-feature
|
vfork stop reason
|
vfork
|
exec-event-feature
|
exec stop reason
|
exec
|
thread-events
|
QThreadEvents
|
Tracking thread lifetime. |
no-resumed-stop-reply
|
no resumed thread left stop reply
|
Tracking thread lifetime. |
Next: Remote Stub, Previous: Server, Up: Remote Debugging [Contents][Index]