GDB/testsuite: Correct gdb.base/watchpoint-solib.exp timeout tweak

Similarly to the previous changes to gdb.reverse/sigall-reverse.exp and
gdb.reverse/until-precsave.exp this corrects the timeout tweak in
gdb.base/watchpoint-solib.exp.

This test case executes a large amount of code with a software watchpoint
enabled.  This means single-stepping all the way through and takes a lot
of time, e.g. for an ARMv7 Panda board and a `-march=armv5te' multilib:

PASS: gdb.base/watchpoint-solib.exp: continue to foo again
elapsed: 714

for the same board and a `-mthumb -march=armv5te' multilib:

PASS: gdb.base/watchpoint-solib.exp: continue to foo again
elapsed: 1275

and for QEMU in the system emulation mode and a `-march=armv4t'
multilib:

PASS: gdb.base/watchpoint-solib.exp: continue to foo again
elapsed: 115

(values in seconds) -- all of which having the default timeout of 60s,
set based on the requirement of the remaining test cases (other than
gdb.reverse ones).

Here again the timeout extension to have a meaning should be calculated
by scaling rather than using an arbitrary constant, and a larger factor
of 30 will do, leaving some margin.  Hopefully for everyone or otherwise
we'll probably have to come up with a smarter solution.

OTOH the other test cases in this script do not require the extension so
they can be moved outside its umbrella so as to avoid unnecessary delays
if something goes wrong and a genuine timeout triggers.

	* gdb.base/watchpoint-solib.exp: Increase the timeout by a factor
	of 30 rather than hardcoding 120 for a slow test case.  Take the
	`gdb,timeout' target setting into account for this calculation.
	Don't extend the timeout for the test cases that don't need it.
This commit is contained in:
Maciej W. Rozycki 2014-09-09 17:39:17 +01:00
parent 7b4159018e
commit 33aeebcf58
2 changed files with 21 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
* gdb.base/watchpoint-solib.exp: Increase the timeout by a factor
of 30 rather than hardcoding 120 for a slow test case. Take the
`gdb,timeout' target setting into account for this calculation.
Don't extend the timeout for the test cases that don't need it.
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
* gdb.reverse/sigall-reverse.exp: Increase the timeout by

View File

@ -70,14 +70,22 @@ gdb_test_multiple "break foo" "set pending breakpoint" {
}
}
set prev_timeout $timeout
set timeout 120
gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo"
gdb_test "watch g" "atchpoint 3: g" "set watchpoint on g"
gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit"
rerun_to_main
gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again"
gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again"
set timeout $prev_timeout
set savedtimeout $timeout
if { [target_info exists gdb,timeout]
&& $timeout < [target_info gdb,timeout] } {
set oldtimeout [target_info gdb,timeout]
} else {
set oldtimeout $timeout
}
set timeout [expr $oldtimeout * 30]
gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again"
set timeout $savedtimeout
gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again"