gdb_main: Implemented a notification to GDB that the "process" has exited when the user runs a new bus scan while attached to a target
This commit is contained in:
parent
d2370f780f
commit
fc55400aad
@ -58,6 +58,7 @@ static char pbuf[BUF_SIZE + 1U];
|
||||
|
||||
static target *cur_target;
|
||||
static target *last_target;
|
||||
static bool gdb_needs_detach_notify = false;
|
||||
|
||||
static void handle_q_packet(char *packet, size_t len);
|
||||
static void handle_v_packet(char *packet, size_t len);
|
||||
@ -68,8 +69,10 @@ static void gdb_target_destroy_callback(struct target_controller *tc, target *t)
|
||||
{
|
||||
(void)tc;
|
||||
if (cur_target == t) {
|
||||
gdb_put_notificationz("%Stop:W00");
|
||||
gdb_out("You are now detached from the previous target.\n");
|
||||
cur_target = NULL;
|
||||
gdb_needs_detach_notify = true;
|
||||
}
|
||||
|
||||
if (last_target == t)
|
||||
@ -635,6 +638,13 @@ static void handle_v_packet(char *packet, const size_t plen)
|
||||
gdb_putpacketz(target_flash_done(cur_target) ? "EFF" : "OK");
|
||||
flash_mode = 0;
|
||||
|
||||
} else if (!strcmp(packet, "vStopped")) {
|
||||
if (gdb_needs_detach_notify) {
|
||||
gdb_putpacketz("W00");
|
||||
gdb_needs_detach_notify = false;
|
||||
} else
|
||||
gdb_putpacketz("OK");
|
||||
|
||||
} else {
|
||||
DEBUG_GDB("*** Unsupported packet: %s\n", packet);
|
||||
gdb_putpacket("", 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user