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 */