X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fserver%2Fgdb_server.c;h=f0b552ddedd1ce042861f1760cc6ddeabcbd16b9;hb=421e75722db1fa173747d07618ef4016b2e3c80e;hp=f54db9e359675116d36a4bb0318f751c459badad;hpb=2517bae6c1438350255dca63e7d1c1e06c64b6bb;p=openocd.git diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index f54db9e359..f0b552dded 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2706,6 +2706,7 @@ static bool gdb_handle_vcont_packet(struct connection *connection, const char *p /* simple case, a continue packet */ if (parse[0] == 'c') { + gdb_running_type = 'c'; LOG_DEBUG("target %s continue", target_name(target)); log_add_callback(gdb_log_callback, connection); retval = target_resume(target, 1, 0, 0, 0); @@ -2732,6 +2733,7 @@ static bool gdb_handle_vcont_packet(struct connection *connection, const char *p /* single-step or step-over-breakpoint */ if (parse[0] == 's') { + gdb_running_type = 's'; bool fake_step = false; if (strncmp(parse, "s:", 2) == 0) { @@ -3014,9 +3016,12 @@ static int gdb_v_packet(struct connection *connection, static int gdb_detach(struct connection *connection) { - target_call_event_callbacks(get_target_from_connection(connection), - TARGET_EVENT_GDB_DETACH); - + /* + * Only reply "OK" to GDB + * it will close the connection and this will trigger a call to + * gdb_connection_closed() that will in turn trigger the event + * TARGET_EVENT_GDB_DETACH + */ return gdb_put_packet(connection, "OK", 2); }