diff options
-rw-r--r-- | gdb/event-top.c | 2 | ||||
-rw-r--r-- | gdb/mi/mi-main.c | 4 | ||||
-rw-r--r-- | gdb/remote-fileio.c | 13 |
3 files changed, 15 insertions, 4 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c index f0a3f0d..3686329 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -1281,6 +1281,8 @@ async_disconnect (gdb_client_data arg) gdb_puts ("Could not kill the program being debugged", gdb_stderr); exception_print (gdb_stderr, exception); + if (exception.reason == RETURN_FORCED_QUIT) + throw; } for (inferior *inf : all_inferiors ()) diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 84a95a2..0013e5d 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1952,6 +1952,10 @@ mi_execute_command (const char *cmd, int from_tty) somewhere. */ mi_print_exception (command->token, result); mi_out_rewind (current_uiout); + + /* Throw to a higher level catch for SIGTERM sent to GDB. */ + if (result.reason == RETURN_FORCED_QUIT) + throw; } bpstat_do_actions (); diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index 3ff2a65..69b4097 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -1191,12 +1191,17 @@ remote_fileio_request (remote_target *remote, char *buf, int ctrlc_pending_p) { do_remote_fileio_request (remote, buf); } + catch (const gdb_exception_forced_quit &ex) + { + throw; + } + catch (const gdb_exception_quit &ex) + { + remote_fileio_reply (remote, -1, FILEIO_EINTR); + } catch (const gdb_exception &ex) { - if (ex.reason == RETURN_QUIT) - remote_fileio_reply (remote, -1, FILEIO_EINTR); - else - remote_fileio_reply (remote, -1, FILEIO_EIO); + remote_fileio_reply (remote, -1, FILEIO_EIO); } } |