Merge pull request #68 from richardeoin/vrun-check-attach
Check target_attach succeeded in vRun command, and return error if not
This commit is contained in:
commit
94c3b2b3d3
|
@ -406,10 +406,15 @@ handle_v_packet(char *packet, int plen)
|
||||||
} else if(last_target) {
|
} else if(last_target) {
|
||||||
cur_target = target_attach(last_target,
|
cur_target = target_attach(last_target,
|
||||||
gdb_target_destroy_callback);
|
gdb_target_destroy_callback);
|
||||||
|
|
||||||
|
/* If we were able to attach to the target again */
|
||||||
|
if (cur_target) {
|
||||||
target_reset(cur_target);
|
target_reset(cur_target);
|
||||||
gdb_putpacketz("T05");
|
gdb_putpacketz("T05");
|
||||||
} else gdb_putpacketz("E01");
|
} else gdb_putpacketz("E01");
|
||||||
|
|
||||||
|
} else gdb_putpacketz("E01");
|
||||||
|
|
||||||
} else if (sscanf(packet, "vFlashErase:%08lx,%08lx", &addr, &len) == 2) {
|
} else if (sscanf(packet, "vFlashErase:%08lx,%08lx", &addr, &len) == 2) {
|
||||||
/* Erase Flash Memory */
|
/* Erase Flash Memory */
|
||||||
DEBUG("Flash Erase %08lX %08lX\n", addr, len);
|
DEBUG("Flash Erase %08lX %08lX\n", addr, len);
|
||||||
|
|
Loading…
Reference in New Issue