Check target_attach succeeded in vRun command, and return error if not

This commit is contained in:
Richard Meadows 2015-01-16 21:52:19 +00:00
parent abcc04d4f3
commit c12002b636
1 changed files with 7 additions and 2 deletions

View File

@ -406,8 +406,13 @@ 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);
target_reset(cur_target);
gdb_putpacketz("T05"); /* If we were able to attach to the target again */
if (cur_target) {
target_reset(cur_target);
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) {