Fixed bug in gdb monitor command.

This commit is contained in:
Daniel Beer 2010-05-12 17:28:59 +12:00
parent 961e7015c9
commit dcc1874434
1 changed files with 6 additions and 0 deletions

6
gdb.c
View File

@ -227,9 +227,15 @@ static int monitor_command(struct gdb_data *data, char *buf)
int len = 0;
while (len + 1 < sizeof(cmd) && *buf && buf[1]) {
if (len + 1 >= sizeof(cmd))
break;
cmd[len++] = (hexval(buf[0]) << 4) | hexval(buf[1]);
buf += 2;
}
cmd[len] = 0;
printf("Monitor command received: %s\n", cmd);
if (!strcasecmp(cmd, "reset")) {
printf("Resetting device\n");