Gdb Remote Serial Protocol; Overview - Red Hat ENTERPRISE LINUX 4 - DEBUGGING WITH GDB Manual

Debugging with gdb
Hide thumbs Also See for ENTERPRISE LINUX 4 - DEBUGGING WITH GDB:
Table of Contents

Advertisement

D.1. Overview
There may be occasions when you need to know something about the protocol--for example, if there
is only one serial port to your target machine, you might want your program to do something special
if it recognizes a packet meant for gdb.
In the examples below,
All gdb commands and responses (other than acknowledgments) are sent as a
introduced with the character
by a two-digit
checksum
$packet-data#checksum
The two-digit
checksum
and the trailing
(an eight bit unsigned checksum).
#
Implementors should note that prior to gdb 5.0 the protocol specification also included an optional
two-digit
sequence-id
$sequence-id:packet-data#checksum
That
sequence-id
Stubs that handle packets added since gdb 5.0 must not accept
When either the host or the target machine receives a packet, the first response expected is an acknowl-
edgment: either
(to indicate the package was received correctly) or
+
-
$packet-data#checksum
-
+
The host (gdb) sends
sends a
. In the case of step and continue
response
operation has completed (the target has again stopped).
consists of a sequence of characters with the exception of
packet-data
additional exceptions).
Fields within the packet should be separated using
are represented in hex with leading zeros suppressed.
Implementors should note that prior to gdb 5.0, the character
in a packet (as it would potentially conflict with the
Response
can be run-length encoded to save space. A
data
encoding giving a repeat count which stands for that many repetitions of the character preceding the
. The encoding is
*
and
are used to indicate transmitted and received data respectfully.
-
-
, the actual
$
:
is computed as the modulo 256 sum of all characters between the leading
:
was appended to the acknowledgment. gdb has never output
s, and the target (the debugging stub incorporated in your program)
command
, yielding a printable character where
n+29

gdb Remote Serial Protocol

, and the terminating character
packet-data
sequence-id
command
or
. Except where otherwise noted all numbers
, ;
:
:
sequence-id
means that the next character is an ascii
*
Appendix D.
packet
.
(to request retransmission):
-
s, the response is only sent when the
and
#
$
could not appear as the third character
).
(which is where rle starts to
n
=3
. A
is
packet
followed
#
$
s.
sequence-id
(see
packet for
X

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 - DEBUGGING WITH GDB and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents