summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2009-10-09 10:31:40 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2009-10-09 10:31:40 +0200
commitc3428f5b7ac2c555a52009cee04d0d1593a4a20c (patch)
tree908332854f3970c9cbd8809b5dbeae157750b97c
parent8f09c5df854426179a84d93de45129a224842de6 (diff)
downloadopenocd_libswd-c3428f5b7ac2c555a52009cee04d0d1593a4a20c.tar.gz
openocd_libswd-c3428f5b7ac2c555a52009cee04d0d1593a4a20c.tar.bz2
openocd_libswd-c3428f5b7ac2c555a52009cee04d0d1593a4a20c.tar.xz
openocd_libswd-c3428f5b7ac2c555a52009cee04d0d1593a4a20c.zip
Stop debug session if halt fails
-rw-r--r--src/server/gdb_server.c7
1 files changed, 6 insertions, 1 deletions
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;
}
}