Inform gdb of the maximum packet size.
Reply to gdb's 'qSupported' query. Tell it that we can receive packets up to MAX_MEM_XFER * 2 bytes long. This significantly speeds up programming a device from gdb.
This commit is contained in:
parent
1b5c1098f5
commit
30c3d8e6f1
1
AUTHORS
1
AUTHORS
|
@ -28,3 +28,4 @@ Andres Vahter <andres.vahter@gmail.com>:
|
|||
|
||||
Robert Spanton <rspanton@zepler.net>:
|
||||
* Support for FET430UIF bootloader programming.
|
||||
* GDB protocol improvements.
|
||||
|
|
10
gdb.c
10
gdb.c
|
@ -495,6 +495,14 @@ static int set_breakpoint(struct gdb_data *data, int enable, char *buf)
|
|||
return gdb_send(data, "OK");
|
||||
}
|
||||
|
||||
static int gdb_send_supported(struct gdb_data *data)
|
||||
{
|
||||
gdb_packet_start(data);
|
||||
gdb_printf(data, "PacketSize=%x", MAX_MEM_XFER * 2);
|
||||
gdb_packet_end(data);
|
||||
return gdb_flush_ack(data);
|
||||
}
|
||||
|
||||
static int process_gdb_command(struct gdb_data *data, char *buf, int len)
|
||||
{
|
||||
switch (buf[0]) {
|
||||
|
@ -514,6 +522,8 @@ static int process_gdb_command(struct gdb_data *data, char *buf, int len)
|
|||
case 'q': /* Query */
|
||||
if (!strncmp(buf, "qRcmd,", 6))
|
||||
return monitor_command(data, buf + 6);
|
||||
if (!strncmp(buf, "qSupported", 10))
|
||||
return gdb_send_supported(data);
|
||||
break;
|
||||
|
||||
case 'm': /* Read memory */
|
||||
|
|
Loading…
Reference in New Issue