aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-interp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index df2b558..60f0666 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -386,6 +386,7 @@ mi_thread_exit (struct thread_info *t, int silent)
{
struct mi_interp *mi;
struct inferior *inf;
+ struct cleanup *old_chain;
if (silent)
return;
@@ -393,11 +394,14 @@ mi_thread_exit (struct thread_info *t, int silent)
inf = find_inferior_pid (ptid_get_pid (t->ptid));
mi = top_level_interpreter_data ();
+ old_chain = make_cleanup_restore_target_terminal ();
target_terminal_ours ();
fprintf_unfiltered (mi->event_channel,
"thread-exited,id=\"%d\",group-id=\"i%d\"",
t->num, inf->num);
gdb_flush (mi->event_channel);
+
+ do_cleanups (old_chain);
}
/* Emit notification on changing the state of record. */