binutils-gdb/gdb/testsuite/lib
Maciej W. Rozycki 4a40f85a84 GDB/testsuite: Avoid timeout lowering
The recent change to introduce `gdb_reverse_timeout' turned out
ineffective for board setups that set the `gdb,timeout' target variable.
A lower `gdb,timeout' setting takes precedence and defeats the effect of
`gdb_reverse_timeout'.  This is because the global timeout is overridden
in gdb_test_multiple and then again in gdb_expect.

Three timeout variables are taken into account in these two places, in
this precedence:

1. The `gdb,timeout' target variable.

2. The caller's local `timeout' variable (upvar timeout)

3. The global `timeout' variable.

This precedence is obeyed by gdb_test_multiple strictly.  OTOH
gdb_expect will select the higher of the two formers and will only take
the latter into account if none of the formers is present.  However the
two timeout selections are conceptually the same and gdb_test_multiple
does its only for the purpose of passing it down to gdb_expect.

Therefore I decided there is no point to keep carrying on this
duplication and removed the sequence from gdb_test_multiple, however
retaining the `upvar timeout' variable definition.  This way gdb_expect
will still access gdb_test_multiple's caller `timeout' variable (if any)
via its own `upvar timeout' reference.

Now as to the sequence in gdb_expect.  In addition to the three
variables described above it also takes a timeout argument into account,
as the fourth value to choose from.  It is currently used if it is
higher than the timeout selected from the variables as described above.

With the timeout selection code from gdb_test_multiple gone, gone is
also the most prominent use of this timeout argument, it's now used in
a couple of places only, mostly within this test framework library code
itself for preparatory commands or suchlike.  With this being the case
this timeout selection code can be simplified as follows:

1. Among the three timeout variables, the highest is always chosen.
   This is so that a test case doesn't inadvertently lower a high value
   timeout needed by slow target boards.  This is what all test cases
   use.

2. Any timeout argument takes precedence.  This is for special cases
   such as within the framework library code, e.g. it doesn't make sense
   to send `set height 0' with a timeout of 7200 seconds.  This is a
   local command that does not interact with the target and setting a
   high timeout here only risks a test suite run taking ages if it goes
   astray for some reason.

3. The fallback timeout of 60s remains.

	* lib/gdb.exp (gdb_test_multiple): Remove code to select the
	timeout, don't pass one down to gdb_expect.
	(gdb_expect): Rework timeout selection.
2014-09-09 16:51:00 +01:00
..
ada.exp
append_gdb_boards_dir.exp
cache.exp
cell.exp
cl_util.c
cl_util.h
compiler.c Add support to recognize clang. 2014-04-07 14:14:03 -07:00
compiler.cc Add support to recognize clang. 2014-04-07 14:14:03 -07:00
cp-support.exp
d-support.exp
dwarf.exp
fortran.exp
future.exp
gdb-guile.exp
gdb-python.exp
gdb-utils.exp Fix paginate-*.exp races 2014-07-25 10:07:38 +01:00
gdb.exp GDB/testsuite: Avoid timeout lowering 2014-09-09 16:51:00 +01:00
gdbserver-support.exp gdbserver-support: Handle gdbserver start failures 2014-09-09 16:17:38 +01:00
go.exp
java.exp
mi-support.exp gdbserver-support: Handle gdbserver start failures 2014-09-09 16:17:38 +01:00
objc.exp
opencl.exp
opencl_hostapp.c
opencl_kernel.cl
pascal.exp
perftest.exp
prelink-support.exp
prompt.exp
range-stepping-support.exp
read1.c Integrate PR 12649's race detector directly in the testsuite machinery 2014-08-20 18:55:54 +01:00
selftest-support.exp
set_unbuffered_mode.c
trace-support.exp Check tracefile is generated by binary execution 2014-04-22 09:57:44 +08:00