diff --git a/src/gdb_main.c b/src/gdb_main.c index 6675e07b141..05a7cca9118 100644 --- a/src/gdb_main.c +++ b/src/gdb_main.c @@ -65,8 +65,6 @@ typedef enum gdb_signal { GDB_SIGLOST = 29, } gdb_signal_e; -#define GDB_MAX_PACKET_SIZE 1024U - #define ERROR_IF_NO_TARGET() \ if (!cur_target) { \ gdb_putpacketz("EFF"); \ @@ -456,7 +454,7 @@ static void exec_q_supported(const char *packet, const size_t length) gdb_putpacket_f("PacketSize=%X;qXfer:memory-map:read+;qXfer:features:read+;" "vContSupported+" GDB_QSUPPORTED_NOACKMODE, - GDB_MAX_PACKET_SIZE); + GDB_PACKET_BUFFER_SIZE); } static void exec_q_memory_map(const char *packet, const size_t length) diff --git a/src/include/gdb_main.h b/src/include/gdb_main.h index b47570b6a59..ea5e3fcffa0 100644 --- a/src/include/gdb_main.h +++ b/src/include/gdb_main.h @@ -23,7 +23,9 @@ #include "target.h" +#ifndef GDB_PACKET_BUFFER_SIZE #define GDB_PACKET_BUFFER_SIZE 1024U +#endif extern bool gdb_target_running; extern target_s *cur_target;