diff options
-rw-r--r-- | gdb/linux-fork.c | 12 | ||||
-rw-r--r-- | gdb/tui/tui-io.c | 8 | ||||
-rw-r--r-- | gdb/tui/tui.c | 7 |
3 files changed, 27 insertions, 0 deletions
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 61545b8..a6e74c0 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -430,6 +430,18 @@ public: fork_load_infrun_state (m_oldfp); insert_breakpoints (); } + catch (const gdb_exception_quit &ex) + { + /* We can't throw from a destructor, so re-set the quit flag + for later QUIT checking. */ + set_quit_flag (); + } + catch (const gdb_exception_forced_quit &ex) + { + /* Like above, but (eventually) cause GDB to terminate by + setting sync_quit_force_run. */ + set_force_quit_flag (); + } catch (const gdb_exception &ex) { warning (_("Couldn't restore checkpoint state in %s: %s"), diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index a17cf38..7752701 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -1271,6 +1271,14 @@ tui_getc (FILE *fp) { return tui_getc_1 (fp); } + catch (const gdb_exception_forced_quit &ex) + { + /* As noted below, it's not safe to let an exception escape + to newline, so, for this case, reset the quit flag for + later QUIT checking. */ + set_force_quit_flag (); + return 0; + } catch (const gdb_exception &ex) { /* Just in case, don't ever let an exception escape to readline. diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index cdae9ff..3604194 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -122,6 +122,13 @@ tui_rl_switch_mode (int notused1, int notused2) tui_enable (); } } + catch (const gdb_exception_forced_quit &ex) + { + /* Ideally, we'd do a 'throw' here, but as noted above, we can't + do that, so, instead, we'll set the necessary flags so that + a later QUIT check will restart the forced quit. */ + set_force_quit_flag (); + } catch (const gdb_exception &ex) { exception_print (gdb_stderr, ex); |