aboutsummaryrefslogtreecommitdiff
path: root/src/gdb_main.c
diff options
context:
space:
mode:
authorMike Smith2011-12-26 02:47:38 -0800
committerMike Smith2011-12-26 02:47:38 -0800
commit00651032ad089711926c175bb252f0c76567c82b (patch)
treeee0de43a2e0e1740fe81ac9d431bdbce933cb140 /src/gdb_main.c
parentbc4c87e45b5b9cc72c46993b1b416017fe4b39a6 (diff)
parent4e0cd081b09d9bd3d444062ca1081fa59c31fc0b (diff)
Merge commit '4e0cd081b09d9bd3d444062ca1081fa59c31fc0b'
* commit '4e0cd081b09d9bd3d444062ca1081fa59c31fc0b': Improved magic number garbage in cortexm3.c Cleaned up debug output on linux build. Removed #if LIGHT for unfinished hardware. Implement gdb 'qCRC' packet to support 'compare-sections' command.
Diffstat (limited to 'src/gdb_main.c')
-rw-r--r--src/gdb_main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gdb_main.c b/src/gdb_main.c
index 9225017..42d7691 100644
--- a/src/gdb_main.c
+++ b/src/gdb_main.c
@@ -45,6 +45,7 @@
#include "target.h"
#include "command.h"
+#include "crc32.h"
#define BUF_SIZE 1024
@@ -68,7 +69,6 @@ gdb_main(void)
SET_IDLE_STATE(1);
size = gdb_getpacket(pbuf, BUF_SIZE);
SET_IDLE_STATE(0);
- DEBUG("%s\n", pbuf);
switch(pbuf[0]) {
/* Implementation of these is mandatory! */
case 'g': { /* 'g': Read general registers */
@@ -286,7 +286,7 @@ gdb_main(void)
}
default: /* Packet not implemented */
- DEBUG("Unsupported packet: %s\n", pbuf);
+ DEBUG("*** Unsupported packet: %s\n", pbuf);
gdb_putpacket("", 0);
}
}
@@ -317,7 +317,8 @@ handle_q_string_reply(const char *str, const char *param)
static void
handle_q_packet(char *packet, int len)
{
- /* These 'monitor' commands only available on the real deal */
+ uint32_t addr, alen;
+
if(!strncmp(packet, "qRcmd,", 6)) {
unsigned char *data;
int datalen;
@@ -362,6 +363,12 @@ handle_q_packet(char *packet, int len)
return;
}
handle_q_string_reply(cur_target->tdesc, packet + 31);
+ } else if (sscanf(packet, "qCRC:%08lX,%08lX", &addr, &alen) == 2) {
+ if(!cur_target) {
+ gdb_putpacketz("E01");
+ return;
+ }
+ gdb_putpacket_f("C%lx", generic_crc32(cur_target, addr, alen));
} else gdb_putpacket("", 0);
}