From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58280 invoked by alias); 18 Nov 2019 17:53:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 58261 invoked by uid 89); 18 Nov 2019 17:53:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=1820 X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Nov 2019 17:53:52 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 1300C20250; Mon, 18 Nov 2019 12:53:50 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 4DBF0200BD; Mon, 18 Nov 2019 12:53:49 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 266C82816F; Mon, 18 Nov 2019 12:53:49 -0500 (EST) X-Gerrit-PatchSet: 2 Date: Mon, 18 Nov 2019 17:53:00 -0000 From: "Andrew Burgess (Code Review)" To: gdb-patches@sourceware.org Cc: Tom Tromey , Simon Marchi Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v2] gdb/testsuite: Introduce compiler_supports_ctf_debug guard function X-Gerrit-Change-Id: I505c11169a9bc9871a31fc0c61e119f92f32cc63 X-Gerrit-Change-Number: 121 X-Gerrit-ChangeURL: X-Gerrit-Commit: 3ccd18cb799aeb28e0606d7d051e4f508b34f5ed In-Reply-To: References: Reply-To: andrew.burgess@embecosm.com, simon.marchi@polymtl.ca, tromey@sourceware.org, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191118175349.266C82816F@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg00527.txt.bz2 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/121 ...................................................................... gdb/testsuite: Introduce compiler_supports_ctf_debug guard function Most versions of GCC in the wild don't support CTF debug format right now, so, rather than attempting to compile the tests and failing each time, this patch introduces a guard function to check if the compiler supports CTF. If we don't have CTF support then the CTF tests are skipped. This patch only updates 3 of the 4 CTF tests, the fourth will be handled in the next patch. gdb/testsuite/ChangeLog: * gdb.base/ctf-constvars.exp: Skip test if CTF is not supported in the compiler. Clean up header comment a little. * gdb.base/ctf-ptype.exp: Likewise. * gdb.base/ctf-whatis.exp: Likewise. * lib/gdb.exp (compiler_supports_ctf_debug): New proc. Change-Id: I505c11169a9bc9871a31fc0c61e119f92f32cc63 --- M gdb/testsuite/ChangeLog M gdb/testsuite/gdb.base/ctf-constvars.exp M gdb/testsuite/gdb.base/ctf-ptype.exp M gdb/testsuite/gdb.base/ctf-whatis.exp M gdb/testsuite/lib/gdb.exp 5 files changed, 42 insertions(+), 20 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3a4d229..aef247f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2019-10-15 Andrew Burgess + + * gdb.base/ctf-constvars.exp: Skip test if CTF is not supported in + the compiler. Clean up header comment a little. + * gdb.base/ctf-ptype.exp: Likewise. + * gdb.base/ctf-whatis.exp: Likewise. + * lib/gdb.exp (skip_ctf_tests): New proc. + 2019-11-14 Tom Tromey * gdb.base/gdbvars.exp (test_convenience_variables): Add diff --git a/gdb/testsuite/gdb.base/ctf-constvars.exp b/gdb/testsuite/gdb.base/ctf-constvars.exp index 4a81a94..fd46d64 100644 --- a/gdb/testsuite/gdb.base/ctf-constvars.exp +++ b/gdb/testsuite/gdb.base/ctf-constvars.exp @@ -18,20 +18,21 @@ # # This file is part of the gdb testsuite # -# tests for const variables -# const pointers to vars -# pointers to const variables -# const pointers to const vars -# with mixed types +# Tests for: const variables, +# const pointers to vars +# pointers to const variables +# const pointers to const vars +# with mixed types. -# -# test running programs -# -# -gt generates full-fledged CTF. +if [skip_ctf_tests] { + unsupported "no ctf debug format support" + return 0 +} standard_testfile .c -set opts "additional_flags=-gt" +# Using `-gt` generates full-fledged CTF debug information. +set opts "additional_flags=-gt" if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile] [list $opts nowarnings]] } { return 0 diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp index 9f54582..68a9662 100644 --- a/gdb/testsuite/gdb.base/ctf-ptype.exp +++ b/gdb/testsuite/gdb.base/ctf-ptype.exp @@ -15,14 +15,15 @@ # This file is a subset of ptype.exp written by Rob Savoye. (rob@cygnus.com) -# -# test running programs -# -# -gt generates full-fledged CTF. +if [skip_ctf_tests] { + unsupported "no ctf debug format support" + return 0 +} standard_testfile .c -set opts "additional_flags=-gt" +# Using `-gt` generates full-fledged CTF debug information. +set opts "additional_flags=-gt" if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile] [list $opts nowarnings]] } { return 0 diff --git a/gdb/testsuite/gdb.base/ctf-whatis.exp b/gdb/testsuite/gdb.base/ctf-whatis.exp index 3f26fc3..626aecb 100644 --- a/gdb/testsuite/gdb.base/ctf-whatis.exp +++ b/gdb/testsuite/gdb.base/ctf-whatis.exp @@ -15,14 +15,15 @@ # This file is a subset of whatis.exp written by Rob Savoye. (rob@cygnus.com) -# -# test running programs -# -# -gt generates full-fledged CTF. +if [skip_ctf_tests] { + unsupported "no ctf debug format support" + return 0 +} standard_testfile .c -set opts "additional_flags=-gt" +# Using `-gt` generates full-fledged CTF debug information. +set opts "additional_flags=-gt" if { [prepare_for_testing "failed to prepare" ${testfile} \ [list $srcfile] [list $opts nowarnings]] } { return 0 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 2d395ef..828c91d 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6787,5 +6787,16 @@ } } +# Does the compiler support CTF debug output using '-gt' compiler +# flag? If not then we should skip these tests. + +gdb_caching_proc skip_ctf_tests { + return ![gdb_can_simple_compile ctfdebug { + int main () { + return 0; + } + } executable "additional_flags=-gt"] +} + # Always load compatibility stuff. load_lib future.exp -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I505c11169a9bc9871a31fc0c61e119f92f32cc63 Gerrit-Change-Number: 121 Gerrit-PatchSet: 2 Gerrit-Owner: Andrew Burgess Gerrit-Reviewer: Andrew Burgess Gerrit-CC: Simon Marchi Gerrit-CC: Tom Tromey Gerrit-MessageType: newpatchset