diff options
Diffstat (limited to 'gdb/mi/mi-main.c')
-rw-r--r-- | gdb/mi/mi-main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index e25eedf..7cb7bf5 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -2171,12 +2171,17 @@ mi_execute_command (const char *cmd, int from_tty) if (report_change) { struct thread_info *ti = inferior_thread (); + struct cleanup *old_chain; + + old_chain = make_cleanup_restore_target_terminal (); + target_terminal_ours_for_output (); - target_terminal_ours (); fprintf_unfiltered (mi->event_channel, "thread-selected,id=\"%d\"", ti->global_num); gdb_flush (mi->event_channel); + + do_cleanups (old_chain); } } |