From: Øyvind Harboe Date: Fri, 9 Oct 2009 08:31:40 +0000 (+0200) Subject: Stop debug session if halt fails X-Git-Tag: v0.3.0-rc0~114 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c3428f5b7ac2c555a52009cee04d0d1593a4a20c;p=openocd Stop debug session if halt fails --- diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index a0077e93..00de5fc6 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -2191,7 +2191,12 @@ int gdb_input_inner(connection_t *connection) { if (target->state == TARGET_RUNNING) { - target_halt(target); + retval = target_halt(target); + if (retval != ERROR_OK) + { + /* stop this debug session */ + target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT); + } gdb_con->ctrl_c = 0; } }