Stop debug session if halt fails

This commit is contained in:
Øyvind Harboe 2009-10-09 10:31:40 +02:00
parent 8f09c5df85
commit c3428f5b7a
1 changed files with 6 additions and 1 deletions

View File

@ -2191,7 +2191,12 @@ int gdb_input_inner(connection_t *connection)
{ {
if (target->state == TARGET_RUNNING) 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; gdb_con->ctrl_c = 0;
} }
} }