btrace: add unsupported/untested messages when skipping tests

We may silently skip gdb.btrace tests if

  - the target does not support record-btrace
  - the target does not support TSX
  - the target does not support gdbserver
  - we fail to compile the test
  - we fail to run to main

Add unsupported/untested messages for each of those.

testsuite/
	* gdb.btrace/buffer-size.exp: Add unsupported/untested message if
	the test is skipped.
	* gdb.btrace/data.exp: Likewise.
	* gdb.btrace/delta.exp: Likewise.
	* gdb.btrace/dlopen.exp: Likewise.
	* gdb.btrace/enable-running.exp: Likewise.
	* gdb.btrace/enable.exp: Likewise.
	* gdb.btrace/exception.exp: Likewise.
	* gdb.btrace/function_call_history.exp: Likewise.
	* gdb.btrace/gcore.exp: Likewise.
	* gdb.btrace/instruction_history.exp: Likewise.
	* gdb.btrace/multi-thread-step.exp: Likewise.
	* gdb.btrace/nohist.exp: Likewise.
	* gdb.btrace/non-stop.exp: Likewise.
	* gdb.btrace/reconnect.exp: Likewise.
	* gdb.btrace/record_goto-step.exp: Likewise.
	* gdb.btrace/record_goto.exp: Likewise.
	* gdb.btrace/rn-dl-bind.exp: Likewise.
	* gdb.btrace/segv.exp: Likewise.
	* gdb.btrace/step.exp: Likewise.
	* gdb.btrace/stepi.exp: Likewise.
	* gdb.btrace/tailcall-only.exp: Likewise.
	* gdb.btrace/tailcall.exp: Likewise.
	* gdb.btrace/tsx.exp: Likewise.
	* gdb.btrace/unknown_functions.exp: Likewise.
	* gdb.btrace/vdso.exp: Likewise.
This commit is contained in:
Markus Metzger 2016-12-09 13:16:22 +01:00
parent cd4007e434
commit b5ac99b082
26 changed files with 196 additions and 79 deletions

View File

@ -1,3 +1,32 @@
2017-02-01 Markus Metzger <markus.t.metzger@intel.com>
* gdb.btrace/buffer-size.exp: Add unsupported/untested message if
the test is skipped.
* gdb.btrace/data.exp: Likewise.
* gdb.btrace/delta.exp: Likewise.
* gdb.btrace/dlopen.exp: Likewise.
* gdb.btrace/enable-running.exp: Likewise.
* gdb.btrace/enable.exp: Likewise.
* gdb.btrace/exception.exp: Likewise.
* gdb.btrace/function_call_history.exp: Likewise.
* gdb.btrace/gcore.exp: Likewise.
* gdb.btrace/instruction_history.exp: Likewise.
* gdb.btrace/multi-thread-step.exp: Likewise.
* gdb.btrace/nohist.exp: Likewise.
* gdb.btrace/non-stop.exp: Likewise.
* gdb.btrace/reconnect.exp: Likewise.
* gdb.btrace/record_goto-step.exp: Likewise.
* gdb.btrace/record_goto.exp: Likewise.
* gdb.btrace/rn-dl-bind.exp: Likewise.
* gdb.btrace/segv.exp: Likewise.
* gdb.btrace/step.exp: Likewise.
* gdb.btrace/stepi.exp: Likewise.
* gdb.btrace/tailcall-only.exp: Likewise.
* gdb.btrace/tailcall.exp: Likewise.
* gdb.btrace/tsx.exp: Likewise.
* gdb.btrace/unknown_functions.exp: Likewise.
* gdb.btrace/vdso.exp: Likewise.
2017-02-01 Markus Metzger <markus.t.metzger@intel.com>
* gdb.btrace/enable-running.c: New.

View File

@ -17,16 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile record_goto.c
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,15 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,15 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile record_goto.c
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -15,8 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if { [skip_btrace_tests] } { return -1 }
if { [skip_shlib_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
if { [skip_shlib_tests] } {
unsupported "target does not support shared library tests"
return -1
}
standard_testfile
@ -26,7 +33,7 @@ set binfile_lib [standard_output_file $basename_lib.so]
if { [gdb_compile_shlib $srcfile_lib $binfile_lib \
[list additional_flags=-fPIC]] != "" } {
untested "failed to compile shared library"
untested "failed to prepare shlib"
return -1
}
@ -36,7 +43,8 @@ if { [prepare_for_testing "failed to prepare" $testfile $srcfile \
}
if ![runto_main] {
return 0
untested "failed to run to main"
return -1
}
# Trace the test function

View File

@ -15,10 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
standard_testfile
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
untested "failed to prepare"
return -1
}
@ -29,6 +33,7 @@ save_vars { GDBFLAGS } {
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,8 +17,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start fresh - without an executable
gdb_exit
@ -35,12 +37,13 @@ gdb_test "record function-call-history" "No record target is currently active\\.
gdb_test "record instruction-history" "No record target is currently active\\..*" "record instruction-history without target"
gdb_test "info record" "No record target is currently active\\." "info record without target"
# start inferior
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}
@ -75,23 +78,28 @@ gdb_test "continue" ".*Inferior.*exited.*" "continue to end"
# otherwise rerun twice, target should be automatically disabled
load_lib gdbserver-support.exp
if [skip_gdbserver_tests] {
unsupported "target does not support gdbserver"
return 0
}
clean_restart $testfile
if ![runto_main] {
untested "failed to run to main"
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}
# make sure record-btrace can be enabled after re-run
clean_restart $testfile
if ![runto_main] {
untested "failed to run to main"
return -1
}
gdb_test_no_output "record btrace"
if ![runto_main] {
untested "failed to run to main"
return -1
}
gdb_test_no_output "record btrace" "enable after re-run"

View File

@ -17,15 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile exception.cc
if [prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,15 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile {} {debug}] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}
@ -226,6 +229,7 @@ gdb_test "record function-call-history /c 21, +11" [multi_line \
# make sure we can handle incomplete trace with respect to indentation
if ![runto_main] {
untested "failed to run to main"
return -1
}
# navigate to the fib in line 24 above

View File

@ -17,16 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile record_goto.c
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,15 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# compile and run to main
standard_testfile .c .S
if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,17 +17,20 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
untested "failed to prepare"
return -1
}
clean_restart $testfile
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,16 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile record_goto.c
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -15,13 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" "$binfile" executable {debug}] != "" } {
untested "failed to prepare"
return -1
}
clean_restart $testfile
@ -29,6 +30,7 @@ clean_restart $testfile
gdb_test_no_output "set non-stop on"
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -19,8 +19,14 @@
load_lib gdbserver-support.exp
if { [skip_btrace_tests] } { return -1 }
if { [skip_gdbserver_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
if { [skip_gdbserver_tests] } {
unsupported "target does not support gdbserver"
return -1
}
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {

View File

@ -17,17 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
standard_testfile record_goto.c
# start inferior
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,8 +17,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# The "record goto" command jumps to a specific instruction in the execution
# trace. To guarantee that we always get the same execution trace, we use
@ -40,14 +42,16 @@ if [info exists COMPILE] {
standard_testfile i686-record_goto.S
}
} else {
verbose "Skipping ${testfile}."
unsupported "target architecture not supported"
return -1
}
if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -21,15 +21,18 @@
# Test that we can reverse-next over the dynamic linker's symbol
# lookup code.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile $srcfile {c++ debug}] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,15 +17,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,17 +17,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
standard_testfile record_goto.c
# start inferior
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,8 +17,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# This test is stepping on instruction level. To guarantee that we always
# get the same execution trace, we use an assembly source file.
@ -38,21 +40,21 @@ if [info exists COMPILE] {
standard_testfile i686-record_goto.S
}
} else {
verbose "Skipping ${testfile}."
unsupported "target architecture not supported"
return -1
}
# start inferior
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
global gdb_prompt
if ![runto_main] {
untested "failed to run to main"
return -1
}
global gdb_prompt
proc check_replay_at { insn } {
gdb_test "info record" [multi_line \
"Active record target: record-btrace" \

View File

@ -20,8 +20,10 @@
# calls. This used to cause a crash in get_frame_type.
#
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# This test requires the compiler to generate a tail call. To guarantee that
# we always get one, we use an assembly source file.
@ -42,14 +44,16 @@ if [info exists COMPILE] {
standard_testfile i686-tailcall-only.S
}
} else {
verbose "Skipping ${testfile}."
unsupported "target architecture not supported"
return -1
}
if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,8 +17,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# This test requires the compiler to generate a tail call. To guarantee that
# we always get one, we use an assembly source file.
@ -39,7 +41,7 @@ if [info exists COMPILE] {
standard_testfile i686-tailcall.S
}
} else {
verbose "Skipping ${testfile}."
unsupported "target architecture not supported"
return -1
}
@ -47,6 +49,7 @@ if [prepare_for_testing "failed to prepare" $testfile $srcfile $opts] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -15,15 +15,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if { [skip_btrace_pt_tests] } { return -1 }
if { [skip_tsx_tests] } { return -1 }
if { [skip_btrace_pt_tests] } {
unsupported "target does not support PT"
return -1
}
if { [skip_tsx_tests] } {
unsupported "target does not support TSX"
return -1
}
# compile and run to main
standard_testfile .c x86-tsx.S
if [prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" {debug}] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}

View File

@ -17,10 +17,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile
# discard local symbols
@ -28,7 +29,9 @@ set ldflags "additional_flags=-Wl,-x"
if [prepare_for_testing "failed to prepare" $testfile $srcfile $ldflags] {
return -1
}
if ![runto test] {
untested "failed to run to main"
return -1
}

View File

@ -20,15 +20,18 @@
#
# Test that we can access the vdso memory during replay for stepping.
# check for btrace support
if { [skip_btrace_tests] } { return -1 }
if { [skip_btrace_tests] } {
unsupported "target does not support record-btrace"
return -1
}
# start inferior
standard_testfile
if [prepare_for_testing "failed to prepare" $testfile $srcfile] {
return -1
}
if ![runto_main] {
untested "failed to run to main"
return -1
}