From: Sandra Loosemore Date: Sat, 13 Oct 2018 00:56:13 +0000 (-0700) Subject: Clean up gdb.trace test results on targets not supporting this feature. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8bca297856b2e54ac093674554f6abd82e7ce6b0;p=binutils-gdb.git Clean up gdb.trace test results on targets not supporting this feature. 2018-10-12 Sandra Loosemore gdb/testsuite/ * gdb.trace/actions-changed.exp: Check for arch support. * gdb.trace/actions.exp: Likewise. * gdb.trace/ax.exp: Likewise. * gdb.trace/backtrace.exp: Likewise. * gdb.trace/change-loc.exp: Likewise. * gdb.trace/deltrace.exp: Likewise. * gdb.trace/ftrace-lock.exp: Check for shlib and arch support. * gdb.trace/ftrace.exp: Likewise. * gdb.trace/infotrace.exp: Check for arch support. * gdb.trace/mi-trace-frame-collected.exp: Likewise. * gdb.trace/mi-tracepoint-changed.exp: Likewise. * gdb.trace/mi-tsv-changed.exp: Likewise. * gdb.trace/packetlen.exp: Likewise. * gdb.trace/passc-dyn.exp: Likewise. * gdb.trace/passcount.exp: Likewise. * gdb.trace/pending.exp: Likewise. * gdb.trace/range-stepping.exp: Check for shlib support. * gdb.trace/report.exp: Check for arch support. * gdb.trace/save-trace.exp: Likewise. * gdb.trace/signal.exp: Check for signal support. * gdb.trace/tfind.exp: Check for arch support. * gdb.trace/trace-break.exp: Check for arch and shlib support. * gdb.trace/trace-common.h: Add comment. * gdb.trace/trace-condition.exp: Check for shlib and arch support. * gdb.trace/trace-enable-disable.exp: Likewise. * gdb.trace/trace-mt.exp: Likewise. Remove redundant untested call. * gdb.trace/tracecmd.exp: Check for arch support. * gdb.trace/tspeed.exp: Check for shlib and target support. * gdb.trace/tstatus.exp: Check for arch support. * gdb.trace/tsv.exp: Likewise. * gdb.trace/while-dyn.exp: Likewise. * gdb.trace/while-stepping.exp: Likewise. * lib/trace-support.exp (gdb_trace_common_supports_arch): New. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 465d606f0e5..fae99216b45 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,39 @@ +2018-10-12 Sandra Loosemore + + * gdb.trace/actions-changed.exp: Check for arch support. + * gdb.trace/actions.exp: Likewise. + * gdb.trace/ax.exp: Likewise. + * gdb.trace/backtrace.exp: Likewise. + * gdb.trace/change-loc.exp: Likewise. + * gdb.trace/deltrace.exp: Likewise. + * gdb.trace/ftrace-lock.exp: Check for shlib and arch support. + * gdb.trace/ftrace.exp: Likewise. + * gdb.trace/infotrace.exp: Check for arch support. + * gdb.trace/mi-trace-frame-collected.exp: Likewise. + * gdb.trace/mi-tracepoint-changed.exp: Likewise. + * gdb.trace/mi-tsv-changed.exp: Likewise. + * gdb.trace/packetlen.exp: Likewise. + * gdb.trace/passc-dyn.exp: Likewise. + * gdb.trace/passcount.exp: Likewise. + * gdb.trace/pending.exp: Likewise. + * gdb.trace/range-stepping.exp: Check for shlib support. + * gdb.trace/report.exp: Check for arch support. + * gdb.trace/save-trace.exp: Likewise. + * gdb.trace/signal.exp: Check for signal support. + * gdb.trace/tfind.exp: Check for arch support. + * gdb.trace/trace-break.exp: Check for arch and shlib support. + * gdb.trace/trace-common.h: Add comment. + * gdb.trace/trace-condition.exp: Check for shlib and arch support. + * gdb.trace/trace-enable-disable.exp: Likewise. + * gdb.trace/trace-mt.exp: Likewise. Remove redundant untested call. + * gdb.trace/tracecmd.exp: Check for arch support. + * gdb.trace/tspeed.exp: Check for shlib and target support. + * gdb.trace/tstatus.exp: Check for arch support. + * gdb.trace/tsv.exp: Likewise. + * gdb.trace/while-dyn.exp: Likewise. + * gdb.trace/while-stepping.exp: Likewise. + * lib/trace-support.exp (gdb_trace_common_supports_arch): New. + 2018-10-12 Simon Marchi * gdb.trace/tspeed.exp: Remove nowarnings. diff --git a/gdb/testsuite/gdb.trace/actions-changed.exp b/gdb/testsuite/gdb.trace/actions-changed.exp index 102f04f7343..34b0ce9be15 100644 --- a/gdb/testsuite/gdb.trace/actions-changed.exp +++ b/gdb/testsuite/gdb.trace/actions-changed.exp @@ -17,6 +17,11 @@ load_lib trace-support.exp standard_testfile +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 } diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp index ea02031c59b..4f4e2540ab7 100644 --- a/gdb/testsuite/gdb.trace/actions.exp +++ b/gdb/testsuite/gdb.trace/actions.exp @@ -22,6 +22,10 @@ gdb_exit gdb_start standard_testfile +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/ax.exp b/gdb/testsuite/gdb.trace/ax.exp index 8156a0c577a..3d1a11a39ee 100644 --- a/gdb/testsuite/gdb.trace/ax.exp +++ b/gdb/testsuite/gdb.trace/ax.exp @@ -24,6 +24,12 @@ load_lib "trace-support.exp" gdb_exit gdb_start standard_testfile actions.c + +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp index 6b41f8945b9..de4c8fe7369 100644 --- a/gdb/testsuite/gdb.trace/backtrace.exp +++ b/gdb/testsuite/gdb.trace/backtrace.exp @@ -21,6 +21,11 @@ standard_testfile actions.c set executable $testfile set expfile $testfile.exp +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if [prepare_for_testing "failed to prepare" $executable $srcfile \ [list debug nowarnings]] { return -1 diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp index 052f421614d..603dd14d187 100644 --- a/gdb/testsuite/gdb.trace/change-loc.exp +++ b/gdb/testsuite/gdb.trace/change-loc.exp @@ -18,6 +18,11 @@ if {[skip_shlib_tests]} { return 0 } +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + standard_testfile set libfile1 "change-loc-1" set libfile2 "change-loc-2" diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace/deltrace.exp index f4ff474fb16..c18df571ba9 100644 --- a/gdb/testsuite/gdb.trace/deltrace.exp +++ b/gdb/testsuite/gdb.trace/deltrace.exp @@ -22,6 +22,12 @@ gdb_exit gdb_start standard_testfile actions.c + +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/ftrace-lock.exp b/gdb/testsuite/gdb.trace/ftrace-lock.exp index 3e5f0b8712f..619bd23f1ed 100644 --- a/gdb/testsuite/gdb.trace/ftrace-lock.exp +++ b/gdb/testsuite/gdb.trace/ftrace-lock.exp @@ -14,6 +14,10 @@ load_lib "trace-support.exp" +if {[skip_shlib_tests]} { + return 0 +} + standard_testfile set executable $testfile set expfile $testfile.exp @@ -29,6 +33,10 @@ set options [list debug [gdb_target_symbol_prefix_flags] \ additional_flags=-DNUM_THREADS=$NUM_THREADS] # Check that the target supports trace. +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } { untested "failed to compile" return -1 diff --git a/gdb/testsuite/gdb.trace/ftrace.exp b/gdb/testsuite/gdb.trace/ftrace.exp index 5c494c6bb4c..959e2affbd3 100644 --- a/gdb/testsuite/gdb.trace/ftrace.exp +++ b/gdb/testsuite/gdb.trace/ftrace.exp @@ -14,6 +14,10 @@ load_lib "trace-support.exp" +if {[skip_shlib_tests]} { + return 0 +} + standard_testfile set executable $testfile set expfile $testfile.exp @@ -21,6 +25,11 @@ set expfile $testfile.exp # Some targets have leading underscores on assembly symbols. set additional_flags [gdb_target_symbol_prefix_flags] +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if [prepare_for_testing "failed to prepare" $executable $srcfile \ [list debug $additional_flags]] { return -1 diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp index b01365822ca..1e33db3eab1 100644 --- a/gdb/testsuite/gdb.trace/infotrace.exp +++ b/gdb/testsuite/gdb.trace/infotrace.exp @@ -22,6 +22,12 @@ gdb_exit gdb_start standard_testfile actions.c + +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp b/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp index 09e9a47221b..56936cc02c4 100644 --- a/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp +++ b/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp @@ -17,6 +17,11 @@ load_lib trace-support.exp standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug}] } { return -1 } diff --git a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp index de7ae40fca8..9808b40d0fe 100644 --- a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp +++ b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp @@ -18,6 +18,10 @@ load_lib trace-support.exp if {[skip_shlib_tests]} { return 0 } +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} standard_testfile pending.c set libfile1 "pendshr1" diff --git a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp index 56dcd3451c8..382a052a696 100644 --- a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp +++ b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp @@ -17,6 +17,12 @@ load_lib trace-support.exp load_lib mi-support.exp standard_testfile actions.c + +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/packetlen.exp b/gdb/testsuite/gdb.trace/packetlen.exp index ca54cfe1596..2322900e44f 100644 --- a/gdb/testsuite/gdb.trace/packetlen.exp +++ b/gdb/testsuite/gdb.trace/packetlen.exp @@ -22,6 +22,10 @@ gdb_exit gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/passc-dyn.exp b/gdb/testsuite/gdb.trace/passc-dyn.exp index 1738b46234a..9457826263e 100644 --- a/gdb/testsuite/gdb.trace/passc-dyn.exp +++ b/gdb/testsuite/gdb.trace/passc-dyn.exp @@ -21,6 +21,10 @@ load_lib "trace-support.exp" gdb_exit gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/passcount.exp b/gdb/testsuite/gdb.trace/passcount.exp index 055020f649f..733c2deb8a3 100644 --- a/gdb/testsuite/gdb.trace/passcount.exp +++ b/gdb/testsuite/gdb.trace/passcount.exp @@ -21,6 +21,10 @@ load_lib "trace-support.exp" gdb_exit gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trace/pending.exp index bb039df4bd5..fbb1c4d08ca 100644 --- a/gdb/testsuite/gdb.trace/pending.exp +++ b/gdb/testsuite/gdb.trace/pending.exp @@ -18,6 +18,11 @@ if {[skip_shlib_tests]} { return 0 } +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + standard_testfile set libfile1 "pendshr1" set libfile2 "pendshr2" diff --git a/gdb/testsuite/gdb.trace/range-stepping.exp b/gdb/testsuite/gdb.trace/range-stepping.exp index 02770328258..1bc0cc74ed0 100644 --- a/gdb/testsuite/gdb.trace/range-stepping.exp +++ b/gdb/testsuite/gdb.trace/range-stepping.exp @@ -66,6 +66,10 @@ proc range_stepping_with_tracepoint { type } { range_stepping_with_tracepoint "trace" +if {[skip_shlib_tests]} { + return 0 +} + set libipa [get_in_proc_agent] set remote_libipa [gdb_load_shlib $libipa] diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp index 5155165b695..4b50e12be0b 100644 --- a/gdb/testsuite/gdb.trace/report.exp +++ b/gdb/testsuite/gdb.trace/report.exp @@ -22,6 +22,10 @@ gdb_exit gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/save-trace.exp b/gdb/testsuite/gdb.trace/save-trace.exp index fe34d3fd1b1..3665778a2ba 100644 --- a/gdb/testsuite/gdb.trace/save-trace.exp +++ b/gdb/testsuite/gdb.trace/save-trace.exp @@ -22,6 +22,10 @@ gdb_exit gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/signal.exp b/gdb/testsuite/gdb.trace/signal.exp index b860b12d634..a01ca97f2f3 100644 --- a/gdb/testsuite/gdb.trace/signal.exp +++ b/gdb/testsuite/gdb.trace/signal.exp @@ -28,6 +28,11 @@ load_lib "trace-support.exp" +if [target_info exists gdb,nosignals] { + verbose "Skipping signal.exp because of nosignals." + return -1 +} + standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp index bbb7ec829dd..ec6a70c2bc4 100644 --- a/gdb/testsuite/gdb.trace/tfind.exp +++ b/gdb/testsuite/gdb.trace/tfind.exp @@ -23,6 +23,11 @@ gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile" \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp index 84c4780ba2a..c4895f94325 100644 --- a/gdb/testsuite/gdb.trace/trace-break.exp +++ b/gdb/testsuite/gdb.trace/trace-break.exp @@ -21,6 +21,11 @@ set expfile $testfile.exp # Some targets have leading underscores on assembly symbols. set additional_flags [gdb_target_symbol_prefix_flags] +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if [prepare_for_testing "failed to prepare" $executable $srcfile \ [list debug $additional_flags]] { return -1 @@ -347,6 +352,10 @@ foreach at_first_loc { "1" "0" } { break_trace_same_addr_6 "trace" "enable" "trace" "disable" break_trace_same_addr_6 "trace" "disable" "trace" "enable" +if {[skip_shlib_tests]} { + return 0 +} + set libipa [get_in_proc_agent] set remote_libipa [gdb_load_shlib $libipa] diff --git a/gdb/testsuite/gdb.trace/trace-common.h b/gdb/testsuite/gdb.trace/trace-common.h index 9f60d7fd7bd..eb34b5c40a3 100644 --- a/gdb/testsuite/gdb.trace/trace-common.h +++ b/gdb/testsuite/gdb.trace/trace-common.h @@ -25,6 +25,9 @@ a fast tracepoint jump. The parameter is the label where we'll set tracepoints and breakpoints. */ +/* Please keep gdb_trace_common_supports_arch in lib/trace-support.exp + in sync when adding new targets to this file. */ + #if (defined __x86_64__ || defined __i386__) static void diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp index d23e6a3f5b7..c7fafd7bd1c 100644 --- a/gdb/testsuite/gdb.trace/trace-condition.exp +++ b/gdb/testsuite/gdb.trace/trace-condition.exp @@ -14,6 +14,10 @@ load_lib "trace-support.exp" +if {[skip_shlib_tests]} { + return 0 +} + standard_testfile set executable $testfile set expfile $testfile.exp @@ -21,6 +25,11 @@ set expfile $testfile.exp # Some targets have leading underscores on assembly symbols. set additional_flags [gdb_target_symbol_prefix_flags] +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if [prepare_for_testing "failed to prepare" $executable $srcfile \ [list debug $additional_flags]] { return -1 diff --git a/gdb/testsuite/gdb.trace/trace-enable-disable.exp b/gdb/testsuite/gdb.trace/trace-enable-disable.exp index 1b3ba0b4bdd..01147ccaab8 100644 --- a/gdb/testsuite/gdb.trace/trace-enable-disable.exp +++ b/gdb/testsuite/gdb.trace/trace-enable-disable.exp @@ -14,6 +14,10 @@ load_lib "trace-support.exp" +if {[skip_shlib_tests]} { + return 0 +} + standard_testfile set executable $testfile set expfile $testfile.exp @@ -22,6 +26,10 @@ set expfile $testfile.exp set options [list debug [gdb_target_symbol_prefix_flags]] # Check that the target supports trace. +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } { untested "failed to compile" return -1 diff --git a/gdb/testsuite/gdb.trace/trace-mt.exp b/gdb/testsuite/gdb.trace/trace-mt.exp index 6e18666111b..dae85a96b6e 100644 --- a/gdb/testsuite/gdb.trace/trace-mt.exp +++ b/gdb/testsuite/gdb.trace/trace-mt.exp @@ -21,9 +21,14 @@ set expfile $testfile.exp # Some targets have leading underscores on assembly symbols. set additional_flags [gdb_target_symbol_prefix_flags] +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if { [gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile \ executable [list debug $additional_flags] ] != "" } { - untested "failed to compile" + # gdb_compile_pthreads provides an appropriate unsupported message. return -1 } @@ -106,6 +111,10 @@ foreach break_always_inserted { "on" "off" } { step_over_tracepoint "trace" +if {[skip_shlib_tests]} { + return 0 +} + set libipa [get_in_proc_agent] set remote_libipa [gdb_load_shlib $libipa] diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace/tracecmd.exp index 6a5d6644a07..de3de8ae171 100644 --- a/gdb/testsuite/gdb.trace/tracecmd.exp +++ b/gdb/testsuite/gdb.trace/tracecmd.exp @@ -21,6 +21,10 @@ load_lib "trace-support.exp" gdb_exit gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/tspeed.exp index bc12afd0a83..b77f412363e 100644 --- a/gdb/testsuite/gdb.trace/tspeed.exp +++ b/gdb/testsuite/gdb.trace/tspeed.exp @@ -15,9 +15,32 @@ load_lib "trace-support.exp" +if {[skip_shlib_tests]} { + return 0 +} + standard_testfile set executable $testfile +# Check that the target supports trace. +if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } { + untested "failed to compile" + return -1 +} + +clean_restart ${testfile} + +if ![runto_main] { + fail "can't run to main to check for trace support" + return -1 +} + +if ![gdb_target_supports_trace] { + unsupported "target does not support trace" + return -1 +} + +# Compile the test case with the in-process agent library. set ipalib [get_in_proc_agent] if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp index 3498b1c13c0..44e599c88fa 100644 --- a/gdb/testsuite/gdb.trace/tstatus.exp +++ b/gdb/testsuite/gdb.trace/tstatus.exp @@ -18,6 +18,11 @@ standard_testfile actions.c set executable $testfile set expfile tstatus.exp +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} + if [prepare_for_testing "failed to prepare" $executable $srcfile \ [list debug]] { return -1 diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp index a86919a75d6..a8ec8d4745b 100644 --- a/gdb/testsuite/gdb.trace/tsv.exp +++ b/gdb/testsuite/gdb.trace/tsv.exp @@ -19,6 +19,10 @@ load_lib "trace-support.exp" gdb_exit gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp index 0fb6b47b0b1..95718797fa0 100644 --- a/gdb/testsuite/gdb.trace/while-dyn.exp +++ b/gdb/testsuite/gdb.trace/while-dyn.exp @@ -23,6 +23,10 @@ gdb_start standard_testfile actions.c set executable $testfile +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp index 29bdf2d1513..45d16201342 100644 --- a/gdb/testsuite/gdb.trace/while-stepping.exp +++ b/gdb/testsuite/gdb.trace/while-stepping.exp @@ -22,6 +22,10 @@ gdb_exit gdb_start standard_testfile actions.c +if ![gdb_trace_common_supports_arch] { + unsupported "no trace-common.h support for arch" + return -1 +} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \ executable {debug nowarnings}] != "" } { untested "failed to compile" diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-support.exp index 547da372b20..e5603d4f6f0 100644 --- a/gdb/testsuite/lib/trace-support.exp +++ b/gdb/testsuite/lib/trace-support.exp @@ -50,6 +50,25 @@ if [is_amd64_regs_target] { set pcreg "pc" } +# +# Procedure: gdb_trace_common_supports_arch +# Returns true if gdb.trace/trace-common.h knows about this target. +# Allows skipping tests that depend on being able to include this file. +# Please keep this in sync with the supported targets in the header. +# + +proc gdb_trace_common_supports_arch { } { + if { [istarget "x86_64*-*-*"] + || [istarget "i386*-*-*"] + || [istarget "aarch64*-*-*"] + || [istarget "powerpc*-*-*"] + || [istarget "s390*-*-*"] } { + return 1 + } else { + return 0 + } +} + # # Procedure: gdb_target_supports_trace # Returns true if GDB is connected to a target that supports tracing.