diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 556fbae856..ad00902901 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2015-06-16 Patrick Palka + + * tui/tui-hooks.c (tui_selected_frame_level_changed_hook): Call + target_terminal_ours_for_output() before calling + tui_show_frame_info(), and restore the original terminal + settings afterwards. + 2015-06-16 Martin Simmons (tiny patch) * arm-linux-nat.c: Include nat/linux-ptrace.h. diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index e53f5264ac..8d8455148a 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -127,11 +127,15 @@ tui_selected_frame_level_changed_hook (int level) { struct frame_info *fi; CORE_ADDR pc; + struct cleanup *old_chain; /* Negative level means that the selected frame was cleared. */ if (level < 0) return; + old_chain = make_cleanup_restore_target_terminal (); + target_terminal_ours_for_output (); + fi = get_selected_frame (NULL); /* Ensure that symbols for this frame are read in. Also, determine the source language of this frame, and switch to it if @@ -160,6 +164,8 @@ tui_selected_frame_level_changed_hook (int level) tui_check_data_values (fi); tui_refreshing_registers = 0; } + + do_cleanups (old_chain); } /* Called from print_frame_info to list the line we stopped in. */