aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 75692d3..08cdb48 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1761,8 +1761,6 @@ quit_force (int *exit_arg, int from_tty)
{
int exit_code = 0;
- undo_terminal_modifications_before_exit ();
-
/* An optional expression may be used to cause gdb to terminate with the
value of that expression. */
if (exit_arg)
@@ -1770,6 +1768,10 @@ quit_force (int *exit_arg, int from_tty)
else if (return_child_result)
exit_code = return_child_result_value;
+ gdb::observers::gdb_exiting.notify (exit_code);
+
+ undo_terminal_modifications_before_exit ();
+
/* We want to handle any quit errors and exit regardless. */
/* Get out of tfind mode, and kill or detach all inferiors. */