From patchwork Thu Oct 11 02:01:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 29703 Received: (qmail 96876 invoked by alias); 11 Oct 2018 02:01:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 95956 invoked by uid 89); 11 Oct 2018 02:01:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=sandra, Sandra, 2210, UD:trace X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 Oct 2018 02:01:18 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gAQHs-0002f8-MA from Sandra_Loosemore@mentor.com ; Wed, 10 Oct 2018 19:01:16 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 10 Oct 2018 19:01:13 -0700 Subject: Re: [patch, testsuite] Clean up gdb.trace results To: Simon Marchi CC: References: <3f5d484c-d001-0447-ebb9-9e906218a5f7@codesourcery.com> From: Sandra Loosemore Message-ID: <8abc8c2c-150c-99d9-e0d5-992225a8cac5@codesourcery.com> Date: Wed, 10 Oct 2018 20:01:11 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: On 10/07/2018 08:24 PM, Simon Marchi wrote: > Thanks for this, fixes to make the testsuite run more cleanly is always > appreciated. > > I just did a quick smoke check, and noticed some errors when running on > x86: > >   Running > /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.trace/signal.exp ... >   ERROR: no fileid for elxacz23q12 > > (elxacz23q12 is my hostname) > > This looks like a check done a bit too early.  Can you make sure that > these tests: > > $ make check TESTS="gdb.trace/*.exp" > $ make check TESTS="gdb.trace/*.exp" > RUNTESTFLAGS="--target_board=native-gdbserver" > $ make check TESTS="gdb.trace/*.exp" > RUNTESTFLAGS="--target_board=native-extended-gdbserver" > > Don't have significant differences before/after your patch (on > x86/Linux)?  If you don't see any difference, maybe the problem is on my > side, then I'll look into it. Thanks, I tried that and made a couple tweaks to the patch to fix those errors. Is this version OK? -Sandra commit 438b4d02aaef566f7a48e32091a65950f25aee31 Author: Sandra Loosemore Date: Wed Oct 10 15:33:49 2018 -0700 Clean up gdb.trace test results. 2018-10-10 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.c: Add missing header for sleep. * gdb.trace/tspeed.exp: Check for shlib and target support. (prepare_for_trace_test): Declare ipalib variable. * 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 f907323..36abace 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,41 @@ +2018-10-10 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.c: Add missing header for sleep. + * gdb.trace/tspeed.exp: Check for shlib and target support. + (prepare_for_trace_test): Declare ipalib variable. + * 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-10 Sergio Durigan Junior * gdb.gdb/unittest.exp: Update expected message informing that diff --git a/gdb/testsuite/gdb.trace/actions-changed.exp b/gdb/testsuite/gdb.trace/actions-changed.exp index 102f04f..34b0ce9 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 ea02031..4f4e254 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 8156a0c..3d1a11a 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 6b41f89..de4c8fe 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 052f421..603dd14 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 f4ff474..c18df57 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 3e5f0b8..619bd23 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 5c494c6..959e2af 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 b013658..1e33db3 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 09e9a47..56936cc 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 de7ae40..9808b40 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 56dcd34..382a052 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 ca54cfe..2322900 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 1738b46..9457826 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 055020f..733c2de 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 bb039df..fbb1c4d 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 0277032..1bc0cc7 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 5155165..4b50e12 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 fe34d3f..3665778 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 b860b12..a01ca97 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 bbb7ec8..ec6a70c 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 84c4780..c4895f9 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 9f60d7f..eb34b5c 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 d23e6a3..c7fafd7 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 1b3ba0b..01147cc 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 6e18666..dae85a9 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 6a5d664..de3de8a 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.c b/gdb/testsuite/gdb.trace/tspeed.c index b084d6a..3c60663 100644 --- a/gdb/testsuite/gdb.trace/tspeed.c +++ b/gdb/testsuite/gdb.trace/tspeed.c @@ -28,6 +28,7 @@ #include #include #include +#include int trace_speed_test (void); diff --git a/gdb/testsuite/gdb.trace/tspeed.exp b/gdb/testsuite/gdb.trace/tspeed.exp index 47a8250..2aba1e5 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 \ @@ -38,6 +61,7 @@ set cr "\[\r\n\]+" proc prepare_for_trace_test {} { global executable + global ipalib clean_restart $executable gdb_load_shlib $ipalib diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp index 3498b1c..44e599c 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 a86919a..a8ec8d4 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 0fb6b47..9571879 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 29bdf2d..45d1620 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 547da37..e5603d4 100644 --- a/gdb/testsuite/lib/trace-support.exp +++ b/gdb/testsuite/lib/trace-support.exp @@ -51,6 +51,25 @@ if [is_amd64_regs_target] { } # +# 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. # Allows tests to abort early if not running on a trace-aware target.