binutils-gdb/gdb/testsuite/lib
Simon Marchi bd447abb24 Make gdb.base/corefile.exp work on terminals with few rows
When creating a pty to spawn a subprocess (such as gdb), Expect
copies the settings of its own controlling terminal, including the
number of rows and columns.  If you "make check" on a terminal with just
a few rows (e.g. 4), GDB will paginate before reaching the initial
prompt.  In default_gdb_start, used by most tests, this is already
handled: if we see the pagination prompt, we sent \n to continue.

Philippe reported that gdb.base/corefile.exp didn't work in terminals
with just a few rows.  This test spawns GDB by hand, because it needs to
check things before the initial prompt, which it couldn't do if it used
default_gdb_start.

In this case I think it's not safe to use the same technique as in
default_gdb_start.  Even if we could send a \n if we see a pagination
prompt, we match some multiline regexes in there.  So if a pagination
slips in there, it might make the regexes not match and fail the test.

It's also not possible to use -ex "set height 0" or -iex "set height 0",
it is handled after the introduction text is shown.

The simplest way I found to avoid showing the pagination completely is
to set stty_init (documented in expect's man page) to initialize gdb's
pty with a fixed number of rows.

And actually, if we set stty_init in gdb_init, it works nicely as a
general solution applicable to all tests.  We can therefore remove the
solution introduced in e882ef3cfc ("testsuite: expect possible
pagination when starting gdb") where we matched the pagination prompt
during startup.

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (default_gdb_start): Don't match pagination
	prompt.
	(gdb_init): Set stty_init.
2019-02-07 09:22:29 -05:00
..
ada.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
append_gdb_boards_dir.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
build-piece.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
cache.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
cell.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
cl_util.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
cl_util.h Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
compile-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
compiler.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
compiler.cc Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
completion-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
cp-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
d-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
data-structures.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
dtrace.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
dwarf.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
fortran.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
future.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb-guile.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb-python.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb-utils.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gdb.exp Make gdb.base/corefile.exp work on terminals with few rows 2019-02-07 09:22:29 -05:00
gdbserver-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
gen-perf-test.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
go.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
memory.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
mi-support.exp gdb/testsuite: Remove interactive prompt case from mi_gdb_test 2019-01-09 10:34:24 +00:00
objc.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
opencl.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
opencl_hostapp.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
opencl_kernel.cl
pascal.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
pdtrace.in Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
perftest.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
prelink-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
prompt.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
range-stepping-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
read1.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
rust-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
selftest-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
set_unbuffered_mode.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
trace-support.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
unbuffer_output.c Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
valgrind.exp Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00