From 8bcdc4892ed9581e8eccfb34ee3ef6d898dfb69a Mon Sep 17 00:00:00 2001 From: Rafael Silva Date: Fri, 13 Dec 2024 15:18:54 +0000 Subject: [PATCH] gdb_main: document PacketSize GDB remote feature format --- src/gdb_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gdb_main.c b/src/gdb_main.c index ea1ed26711a..dc145247cc9 100644 --- a/src/gdb_main.c +++ b/src/gdb_main.c @@ -467,7 +467,12 @@ static void exec_q_supported(const char *packet, const size_t length) */ gdb_set_noackmode(false); - gdb_putpacket_str_f("PacketSize=%X;qXfer:memory-map:read+;qXfer:features:read+;" + /* + * The Remote Protocol documentation is not clear on what format the PacketSize feature should be in, + * according to the GDB source code (as of version 15.2) it should be a hexadecimal encoded number + * to be parsed by strtoul() with a base of 16. + */ + gdb_putpacket_str_f("PacketSize=%x;qXfer:memory-map:read+;qXfer:features:read+;" "vContSupported+" GDB_QSUPPORTED_NOACKMODE, GDB_PACKET_BUFFER_SIZE); }