diff options
author | Ciaran Woodward <ciaranwoodward@xmos.com> | 2024-04-22 15:09:57 +0000 |
---|---|---|
committer | Ciaran Woodward <ciaranwoodward@xmos.com> | 2024-04-24 16:32:43 +0100 |
commit | f908b93b48634083338eed5183ac519db8925b38 (patch) | |
tree | ce812c439bec104c1ddd4d063e3126a874746f5b /gdb/ctfread.h | |
parent | 730f5068f5fb6613e4faa2efc2309cd107562cbd (diff) | |
download | gdb-f908b93b48634083338eed5183ac519db8925b38.zip gdb-f908b93b48634083338eed5183ac519db8925b38.tar.gz gdb-f908b93b48634083338eed5183ac519db8925b38.tar.bz2 |
gdb/doc: Fix incorrect information in RSP doc
The 'PacketSize' attribute of the qSupported packet was
documented to be the maximum size of the packet including
the frame and checksum bytes, however this is not how it
was treated in the code. In reality, PacketSize is the
maximum size of the data in the RSP packets, not including
the framing or checksum bytes.
For instance, GDB's remote.c treats it as the maximum
number of data bytes. See remote_read_bytes_1, where the
size of the request is capped at PacketSize/2 (for
hex-encoding).
Also see gdbserver's server.cc, where the internal buffer
is sized as PBUFSIZ and PBUFSIZ-1 is used as PacketSize.
In gdbserver's case, the buffer is not used for any of the
framing or checksum characters. (I am not certain where the -1
comes from. I think it comes from back when there were no
binary packets, so packets were treated as strings with
null terminators).
It also seems like gdbservers in the wild treat it in
this way:
Embocosm doc:
https://www.embecosm.com/appnotes/ean4/embecosm-howto-rsp-server-ean4-issue-2.html#id3078000
A quick glance over openocd's gdb_server.c gdb_put_packet_inner()
function shows that the internal buffer also excludes the framing
and checksum.
Likewise, qEmu's gdbstub.c allocates PacketSize bytes for
the internal packet contents, and PacketSize+4 for the
full frame.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Pedro Alves <pedro@palves.net>
Diffstat (limited to 'gdb/ctfread.h')
0 files changed, 0 insertions, 0 deletions