From 28cf56ce4f85d3f32bfd1703ae56e736aa2cf4ce Mon Sep 17 00:00:00 2001 From: Neo Xu Date: Wed, 5 Feb 2025 11:29:28 +0800 Subject: [PATCH] gdbstub: fix memory binary upload on latest GDB GDB release 16.2 recently to fix the incompatibility issue with LLDB. For us, the only change is stub must report it support feature 'binary-upload' before GDB will use this feature. For more information, find bug report and discussion in https://sourceware.org/bugzilla/show_bug.cgi?id=32593 Use GDB 16.2, now it works with binary upload. ``` [remote] Sending packet: $x39c,4#a7 [remote] Received Ack [remote] Packet received: b\000\203 ``` Signed-off-by: Neo Xu --- libs/libc/gdbstub/lib_gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/libc/gdbstub/lib_gdbstub.c b/libs/libc/gdbstub/lib_gdbstub.c index bbc5a8e0c8..ca72821c98 100644 --- a/libs/libc/gdbstub/lib_gdbstub.c +++ b/libs/libc/gdbstub/lib_gdbstub.c @@ -1387,11 +1387,11 @@ static int gdb_query(FAR struct gdb_state_s *state) { #ifdef CONFIG_ARCH_HAVE_DEBUG state->pkt_len = sprintf(state->pkt_buf, - "hwbreak+;PacketSize=%zx", + "binary-upload+;hwbreak+;PacketSize=%zx", sizeof(state->pkt_buf)); #else state->pkt_len = sprintf(state->pkt_buf, - "PacketSize=%zx", + "binary-upload+;PacketSize=%zx", sizeof(state->pkt_buf)); #endif gdb_send_packet(state);