old-cross-binutils/gdb/testsuite/gdb.reverse/until-precsave.exp
Maciej W. Rozycki 7b4159018e GDB/testsuite: Add/correct gdb.reverse timeout tweaks
There are three cases in two scripts in the gdb.reverse subset that
take a particularly long time.  Two of them are already attempted to
take care of by extending the timeout from the default.  The remaining
one has no precautions taken.  The timeout extension is ineffective
though, it is done by adding a constant rather than by scaling and as
a result while it may work for target boards that get satisfied with
the detault test timeout of 10s, it does not serve its purpose for
slower ones.

Here are indicative samples of execution times (in seconds) observed
for these cases respectively, for an ARMv7 Panda board running Linux
and a `-march=armv5te' multilib:

PASS: gdb.reverse/sigall-reverse.exp: continue to signal exit
elapsed: 385
PASS: gdb.reverse/until-precsave.exp: run to end of main
elapsed: 4440
PASS: gdb.reverse/until-precsave.exp: save process recfile
elapsed: 965

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

PASS: gdb.reverse/sigall-reverse.exp: continue to signal exit
elapsed: 465
PASS: gdb.reverse/until-precsave.exp: run to end of main
elapsed: 4191
PASS: gdb.reverse/until-precsave.exp: save process recfile
elapsed: 669

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

PASS: gdb.reverse/sigall-reverse.exp: continue to signal exit
elapsed: 45
PASS: gdb.reverse/until-precsave.exp: run to end of main
elapsed: 433
PASS: gdb.reverse/until-precsave.exp: save process recfile
elapsed: 104

Based on the performance of other tests these two test configurations
have their default timeout set to 450s and 60s respectively.

The remaining two multilibs (`-mthumb -march=armv4t' and `-mthumb
-march=armv7-a') do not produce test results usable enough to have data
available for these cases.

 Based on these results I have tweaked timeouts for these cases as
follows.  This, together with a suitable board timeout setting, removes
timeouts for these cases.  Note that for the default timeout of 10s the
new setting for the first case in gdb.reverse/until-precsave.exp is
compatible with the old one, just a bit higher to keep the convention
of longer timeouts to remain multiples of 30s.  The second case there
does not need such a high setting so I have lowered it a bit to avoid
an unnecessary delay where this test case genuinely times out.

	* gdb.reverse/sigall-reverse.exp: Increase the timeout by
	a factor of 2 for a slow test case.  Take the `gdb,timeout'
	target setting into account for this calculation.
	* gdb.reverse/until-precsave.exp: Increase the timeout by
	a factor of 15 and 3 respectively rather than adding 120
	for a pair of slow test cases.  Take the `gdb,timeout'
	target setting into account for this calculation.
2014-09-09 17:03:24 +01:00

156 lines
4.8 KiB
Text

# Copyright 2008-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
# This file is part of the GDB testsuite. It tests 'until' and
# 'advance' in precord logfile.
# This test suitable only for process record-replay
if ![supports_process_record] {
return
}
standard_testfile until-reverse.c ur1.c
set precsave [standard_output_file until.precsave]
if { [prepare_for_testing $testfile.exp $testfile \
[list $srcfile $srcfile2]] } {
return -1
}
set bp_location1 [gdb_get_line_number "set breakpoint 1 here"]
set bp_location7 [gdb_get_line_number "set breakpoint 7 here"]
set bp_location9 [gdb_get_line_number "set breakpoint 9 here" "$srcfile2"]
set bp_location19 [gdb_get_line_number "set breakpoint 19 here"]
set bp_location20 [gdb_get_line_number "set breakpoint 20 here"]
set bp_location21 [gdb_get_line_number "set breakpoint 21 here"]
runto main
if [supports_process_record] {
# Activate process record/replay
gdb_test_no_output "record" "Turn on process record"
}
set end_of_main [gdb_get_line_number "set breakpoint 10a here" ]
gdb_test "break $end_of_main" \
"Breakpoint $decimal at .*/$srcfile, line $end_of_main\." \
"BP at end of main"
# This can take awhile.
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 * 15]
gdb_test "continue" "Breakpoint .* set breakpoint 10a here .*" "run to end of main"
# So can this, against gdbserver, for example.
set timeout [expr $oldtimeout * 3]
gdb_test "record save $precsave" \
"Saved core file $precsave with execution log\." \
"save process recfile"
set timeout $savedtimeout
gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
"Program terminated with signal .*" \
"reload core file"
# Verify that plain vanilla "until <location>" works.
#
gdb_test "until $bp_location1" \
"main .* at .*:$bp_location1.*" \
"until line number"
# Advance up to factorial, outer invocation
#
gdb_test "advance factorial" \
"factorial .value=6..*$srcfile:$bp_location7.*" \
"advance to factorial"
# At this point, 'until' should continue the inferior up to when all the
# inner invocations of factorial() are completed and we are back at this
# frame.
#
gdb_test "until $bp_location19" \
"factorial .value=720.*${srcfile}:$bp_location19.*" \
"until factorial, recursive function"
# Finish out to main scope
#
gdb_test "finish" \
" in main .*$srcfile:$bp_location1.*" \
"finish to main"
# Advance to a function called by main (marker2)
#
gdb_test "advance marker2" \
"marker2 .a=43.*$srcfile2:$bp_location9.*" \
"advance to marker2"
# Now issue an until with another function, not called by the current
# frame, as argument. This should not work, i.e. the program should
# stop at main, the caller, where we put the 'guard' breakpoint.
#
set test_msg "until func, not called by current frame"
gdb_test_multiple "until marker3" "$test_msg" {
-re "main .*at .*${srcfile}:$bp_location20.*$gdb_prompt $" {
pass "$test_msg"
}
-re "main .*at .*${srcfile}:$bp_location21.*$gdb_prompt $" {
pass "$test_msg"
}
}
###
###
###
# Set reverse execution direction
gdb_test_no_output "set exec-dir reverse" "set reverse execution"
#
# We should now be at main, after the return from marker2.
# "Advance" backward into marker2.
#
gdb_test "advance marker2" \
"marker2 .a=43.*$srcfile2:$bp_location9.*" \
"reverse-advance to marker2"
# Finish out to main scope (backward)
gdb_test "finish" \
" in main .*$srcfile:$bp_location20.*" \
"reverse-finish from marker2"
# Advance backward to last line of factorial (outer invocation)
gdb_test "advance $bp_location19" \
"factorial .value=720.*${srcfile}:$bp_location19.*" \
"reverse-advance to final return of factorial"
# Now do "until" across the recursive calls,
# ending up in the same frame where we are now.
gdb_test "until $bp_location7" \
"factorial .value=6..*$srcfile:$bp_location7.*" \
"reverse-until to entry of factorial"