From 5817f6153deb805ac3c3819558a1b905a3d9f817 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Thu, 5 Sep 2024 14:29:36 +0800 Subject: [PATCH] gdbstub:expand buffer size to increase transfer speed Signed-off-by: anjiahao --- libs/libc/gdbstub/Kconfig | 6 ++++++ libs/libc/gdbstub/lib_gdbstub.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/libc/gdbstub/Kconfig b/libs/libc/gdbstub/Kconfig index a3a2ee1b2c..0d9f46d828 100644 --- a/libs/libc/gdbstub/Kconfig +++ b/libs/libc/gdbstub/Kconfig @@ -17,4 +17,10 @@ config LIB_GDBSTUB_DEBUG ---help--- Add debug info to gdbstub +config LIB_GDBSTUB_PKTSIZE + int "Gdbstub packet size" + default 32768 + ---help--- + The size of the gdbstub packet buffer. + endif diff --git a/libs/libc/gdbstub/lib_gdbstub.c b/libs/libc/gdbstub/lib_gdbstub.c index 4d78e1baf9..fd8f73997d 100644 --- a/libs/libc/gdbstub/lib_gdbstub.c +++ b/libs/libc/gdbstub/lib_gdbstub.c @@ -50,6 +50,8 @@ # define GDB_ASSERT() do {} while (0) #endif +#define BUFSIZE CONFIG_LIB_GDBSTUB_PKTSIZE + /**************************************************************************** * Private Types ****************************************************************************/ @@ -66,7 +68,7 @@ struct gdb_state_s FAR void *last_stopaddr; /* Last stop address */ pid_t pid; /* Gdb current thread */ FAR char *pkt_next; /* Pointer to next byte in packet */ - char pkt_buf[1024]; /* Packet buffer */ + char pkt_buf[BUFSIZE]; /* Packet buffer */ size_t pkt_len; /* Packet send and receive length */ uint8_t running_regs[XCPTCONTEXT_SIZE]; /* Registers of running thread */ size_t size; /* Size of registers */