forked from Imagelibrary/binutils-gdb
Fix PR gdb/393:
* inflow.c (terminal_save_ours): New function to save terminal settings. * inferior.h (terminal_save_ours): Declare. * target.c (debug_to_terminal_save_ours): New function. (cleanup_target): Defaults to_terminal_save_ours. (update_current_target): Inherit to_terminal_save_ours. (setup_target_debug): Set to_terminal_save_ours. * target.h (target_terminal_save_ours): New to save terminal settings. (target_ops): New member to_terminal_save_ours. * gnu-nat.c (init_gnu_ops): Set to_terminal_save_ours. * hpux-thread.c (init_hpux_thread_ops): Likewise. * inftarg.c (init_child_ops): Likewise. * m3-nat.c (init_m3_ops): Likewise. * procfs.c (init_procfs_ops): Likewise. * wince.c (init_child_ops): Likewise. * win32-nat.c (init_child_ops): Likewise. * sol-thread.c (init_sol_thread_ops): Likewise.
This commit is contained in:
17
gdb/inflow.c
17
gdb/inflow.c
@@ -200,6 +200,23 @@ terminal_init_inferior_with_pgrp (int pgrp)
|
||||
}
|
||||
}
|
||||
|
||||
/* Save the terminal settings again. This is necessary for the TUI
|
||||
when it switches to TUI or non-TUI mode; curses changes the terminal
|
||||
and gdb must be able to restore it correctly. */
|
||||
|
||||
void
|
||||
terminal_save_ours ()
|
||||
{
|
||||
if (gdb_has_a_terminal ())
|
||||
{
|
||||
/* We could just as well copy our_ttystate (if we felt like adding
|
||||
a new function serial_copy_tty_state). */
|
||||
if (our_ttystate)
|
||||
xfree (our_ttystate);
|
||||
our_ttystate = serial_get_tty_state (stdin_serial);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
terminal_init_inferior (void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user