The following table provides a complete list of all currently defined commands and their corresponding response data.
Enable extended mode. In extended mode, the remote server is made persistent. The R packet is used to restart the program being debugged.
Reply:
The remote target both supports and has enabled extended mode.
Indicate the reason the target halted. The reply is the same as for step and continue.
Reply: (refer to Section D.3 Stop Reply Packets, for the reply specifications.
Reserved for future use.
Initialized argv[] array passed into program. arglen specifies the number of bytes in the hex encoded byte stream arg. See gdbserver for more details.
Reply:
No other details.
Change the serial line speed to baud.
JTC: When does the transport layer state change? When it's received, or after the ACK is transmitted. In either case, there are problems if the command or the acknowledgment packet is dropped.
Stan: If people really wanted to add something like this, and get it working for the first time, they ought to modify ser-unix.c to send some kind of out-of-band message to a specially-setup stub and have the switch happen "in between" packets, so that from remote protocol's point of view, nothing actually happened.
Set (mode is S) or clear (mode is C) a breakpoint at addr.
This packet has been replaced by the Z and z packets.
addr is address to resume. If addr is omitted, resume at current address.
Reply: (refer to Section D.3 Stop Reply Packets, for the reply specifications.
Continue with signal sig (hex signal number). If ;addr is omitted, resume at same address.
Reply: (refer to Section D.3 Stop Reply Packets, for the reply specifications.
Toggle debug flag.
Detach gdb from the remote system. Sent to the remote target before gdb disconnects via the detach command.
Reply:
{No value for ` <listitem>GDBN'} does not check for any response after sending this packet.
Reserved for future use.
Reserved for future use.
Reserved for future use.
This packet is send by gdb as reply to a F request packet sent by the target. This is part of the File-I/O protocol extension. Refer to Section D.7 File-I/O remote protocol extension, for the specification.
Read general registers.
Reply:
Each byte of register data is described by two hex digits. The bytes with the register are transmitted in target byte order. The size of each register and their position within the g packet are determined by the gdb internal macros REGISTER_RAW_SIZE and REGISTER_NAME macros. The specification of several standard g packets is specified below.
for an error.
Reply:
for success
for an error
Reserved for future use.
Set thread for subsequent operations (m, M, g, G, et.al.). c depends on the operation to be performed: it should be c for step and continue operations, g for other operations. The thread designator t… may be -1, meaning all the threads, a thread number, or zero which means pick any thread.
Reply:
for success
for an error
Step the remote target by a single clock cycle. If ,nnn is present, cycle step nnn cycles. If addr is present, cycle step starting at that address.
Reserved for future use.
Reserved for future use.
FIXME: There is no description of how to operate when a specific thread context has been selected (that is, does 'k' kill only that thread?).
Reserved for future use.
Reserved for future use.
Reserved for future use.
Read length bytes of memory starting at address addr. Neither gdb nor the stub assume that sized memory transfers are assumed using word aligned accesses. FIXME: A word aligned memory transfer mechanism is needed.
Reply:
XX… is mem contents. Can be fewer bytes than requested if able to read only part of the data. Neither gdb nor the stub assume that sized memory transfers are assumed using word aligned accesses. FIXME: A word aligned memory transfer mechanism is needed.
NN is errno
Write length bytes of memory starting at address addr. XX… is the data.
Reply:
for success
for an error (this includes the case where only part of the data was written).
Reserved for future use.
Reserved for future use.
Reserved for future use.
Reserved for future use.
Reply:
The hex encoded value of the register in target byte order.
Write register n… with value r…, which contains two hex digits for each byte in the register (target byte order).
Reply:
for success
for an error
Request info about query. In general gdb queries have a leading upper case letter. Custom vendor queries should use a company prefix (in lower case) ex: qfsf.var. query may optionally be followed by a , or ; separated list. Stubs must ensure that they match the full query name.
Reply:
Hex encoded data from query. The reply can not be empty.
error reply
Indicating an unrecognized query.
Set value of var to val.
Refer to Section D.4 General Query Packets, for a discussion of naming conventions.
Reset the entire system.
Restart the program being debugged. XX, while needed, is ignored. This packet is only available in extended mode.
Reply:
The R packet has no reply.
addr is address to resume. If addr is omitted, resume at same address.
Reply: (refer to Section D.3 Stop Reply Packets, for the reply specifications.
Like C but step not continue.
Reply: (refer to Section D.3 Stop Reply Packets, for the reply specifications.
Search backwards starting at address addr for a match with pattern PP and mask MM. PP and MM are 4 bytes. addr must be at least 3 digits.
Find out if the thread XX is alive.
Reply:
thread is still alive
thread is dead
Reserved for future use.
Reserved for future use.
Reserved for future use.
Reserved for future use.
Reserved for future use.
Reserved for future use.
Reserved for future use.
addr is address, length is number of bytes, XX… is binary data. The characters $, #, and 0x7d are escaped using 0x7d.
Reply:
for success
for an error
Reserved for future use.
Reserved for future use.
Insert (Z) or remove (z) a type breakpoint or watchpoint starting at address address and covering the next length bytes.
Each breakpoint and watchpoint packet type is documented separately.
Implementation notes: A remote target shall return an empty string for an unrecognized breakpoint or watchpoint packet type. A remote target shall support either both or neither of a given Ztype… and ztype… packet pair. To avoid potential problems with duplicate packets, the operations should be implemented in an idempotent way.
Insert (Z0) or remove (z0) a memory breakpoint at address addr of size length.
A memory breakpoint is implemented by replacing the instruction at addr with a software breakpoint or trap instruction. The length is used by targets that indicates the size of the breakpoint (in bytes) that should be inserted (e.g., the arm and mips can insert either a 2 or 4 byte breakpoint).
Implementation note: It is possible for a target to copy or move code that contains memory breakpoints (e.g., when implementing overlays). The behavior of this packet, in the presence of such a target, is not defined.
Reply:
success
not supported
for an error
Insert (Z1) or remove (z1) a hardware breakpoint at address addr of size length.
A hardware breakpoint is implemented using a mechanism that is not dependant on being able to modify the target's memory.
Implementation note: A hardware breakpoint is not affected by code movement.
Reply:
success
not supported
for an error
Insert (Z2) or remove (z2) a write watchpoint.
Reply:
success
not supported
for an error
Insert (Z3) or remove (z3) a read watchpoint.
Reply:
success
not supported
for an error
Insert (Z4) or remove (z4) an access watchpoint.
Reply:
success
not supported
for an error