Fix restoring of inferior terminal settings
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 22 Aug 2018 15:09:45 +0000 (11:09 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 22 Aug 2018 15:09:45 +0000 (11:09 -0400)
commitae739fe7b8cffac2332666d62ad37cab679a7758
treef0669586a670a4ce8fe223dbd47a0c728d38994a
parent467dc1e2ea5a8b300b61194aa8565829ce7d65bc
Fix restoring of inferior terminal settings

I noticed that the child_terminal_save_inferior function was not used
since the commit f6ac5f3d63e0 ("Convert struct target_ops to C++").  I
was able to make a little test program to illustrate the problem (see
test case).

I think we're just missing the override of the terminal_save_inferior
method in inf_child_target (along with the other terminal-related
methods).

Instead of creating a new test, I thought that gdb.base/term.exp was a
good candidate for testing that gdb restores properly the inferior's
terminal settings.

gdb/ChangeLog:

* inf-child.h (inf_child_target) <terminal_save_inferior>: New.
* inf-child.c (inf_child_target::terminal_save_inferior): New.

gdb/testsuite/ChangeLog:

* gdb.base/term.exp: Compare terminal settings with values from
the inferior.
* gdb.base/term.c: Get and set terminal settings.
gdb/ChangeLog
gdb/inf-child.c
gdb/inf-child.h
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/term.c
gdb/testsuite/gdb.base/term.exp