
Normally the gdb.reverse/*.exp test-cases pass on my system (apart from the record/23188 KFAIL for gdb.reverse/step-precsave.exp). But when specifying GLIBC_TUNABLES=glibc.tune.hwcaps=-XSAVEC_Usable to force glibc to use _dl_runtime_resolve_xsave instead of _dl_runtime_resolve_xsavec, we run into 1054 FAILs like this: ... (gdb) PASS: gdb.reverse/sigall-reverse.exp: b gen_HUP continue^M Continuing.^M Process record does not support instruction 0xfae64 at address \ 0x7ffff7ded958.^M Process record: failed to record execution log.^M ^M Program stopped.^M 0x00007ffff7ded958 in _dl_runtime_resolve_xsave () from \ /lib64/ld-linux-x86-64.so.2^M (gdb) FAIL: gdb.reverse/sigall-reverse.exp: get signal ABRT ... The problem is that the xsave instruction is not supported in reverse-debugging (PR record/25038). Add KFAILs for this PR. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-10-13 Tom de Vries <tdevries@suse.de> PR record/25038 * gdb.reverse/sigall-precsave.exp: Add PR record/25038 KFAIL. * gdb.reverse/sigall-reverse.exp: Same. * gdb.reverse/solib-precsave.exp: Same. * gdb.reverse/solib-reverse.exp: Same. * gdb.reverse/step-precsave.exp: Same. * gdb.reverse/until-precsave.exp: Same. * gdb.reverse/until-reverse.exp: Same. * lib/gdb.exp (gdb_continue_to_breakpoint): Same.
133 lines
4 KiB
Text
133 lines
4 KiB
Text
# Copyright 2008-2019 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 reverse debugging.
|
|
|
|
if ![supports_reverse] {
|
|
return
|
|
}
|
|
|
|
standard_testfile .c ur1.c
|
|
|
|
if { [prepare_for_testing "failed to prepare" $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_location8 [gdb_get_line_number "set breakpoint 8 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"
|
|
}
|
|
|
|
# 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
|
|
#
|
|
set test "advance to factorial"
|
|
set pass_pattern "factorial .value=6..*$srcfile:$bp_location7.*"
|
|
set kfail_pattern "Process record does not support instruction 0xfae64 at.*"
|
|
gdb_test_multiple "advance factorial" $test {
|
|
-re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" {
|
|
pass "$test"
|
|
}
|
|
-re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" {
|
|
kfail "gdb/25038" $test
|
|
return -1
|
|
}
|
|
}
|
|
|
|
# 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" \
|
|
"main .*$srcfile:.*" \
|
|
"finish to main"
|
|
|
|
# Advance to a function called by main (marker2)
|
|
#
|
|
gdb_test "advance marker2" \
|
|
"marker2 .a=43.*$srcfile2:$bp_location8.*" \
|
|
"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_location8.*" \
|
|
"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"
|