From patchwork Thu Aug 29 12:47:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 34321 Received: (qmail 88645 invoked by alias); 29 Aug 2019 12:47:26 -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 88586 invoked by uid 89); 29 Aug 2019 12:47:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Aug 2019 12:47:24 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2B218AD54; Thu, 29 Aug 2019 12:47:22 +0000 (UTC) Subject: [committed][gdb/testsuite] Fix gdb.fortran/info-types.exp regexp To: Andrew Burgess , gdb-patches@sourceware.org Cc: Richard Bunt References: <5184ae288c08432d0e873fd48b8c56619e3d2699.1564243858.git.andrew.burgess@embecosm.com> <20190828123722.GW6076@embecosm.com> From: Tom de Vries Openpgp: preference=signencrypt Message-ID: Date: Thu, 29 Aug 2019 14:47:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190828123722.GW6076@embecosm.com> X-IsSubscribed: yes [ was: Re: [PATCH 5/7] gdb/fortran: Don't include module symbols when searching for types ] On 28-08-19 14:37, Andrew Burgess wrote: > * Andrew Burgess [2019-07-27 17:22:33 +0100]: > >> Currently the 'info types' command will return symbols that correspond >> to Fortran modules. This because the symbols are created with domain >> MODULE_DOMAIN, but address_class LOC_TYPEDEF, which is the same >> address_class as type symbols. >> >> This commit explicitly prevents MODULE_DOMAIN symbols from appearing >> when we search for symbols in the TYPES_DOMAIN, this prevents the >> module symbols from appearing in the output of 'info types'. >> >> gdb/ChangeLog: >> >> * symtab.c (search_symbols): Don't include MODULE_DOMAIN symbols >> when searching for types. >> >> gdb/testsuite/ChangeLog: >> >> * gdb.fortran/info-types.exp: Add module. >> * gdb.fortran/info-types.f90: Update expected results. > > I've now pushed this patch as it only depended on the previous patch > in this series. I've committed this fix for the test-case. Thanks, - Tom [gdb/testsuite] Fix gdb.fortran/info-types.exp regexp The gdb.fortran/info-types.exp test-case passes with gcc 7 (though not on openSUSE, due to the extra debug info) and fails with gcc 4.8 and gcc 8. Fix the gdb_test regexp to fix all those cases. gdb/testsuite/ChangeLog: 2019-08-29 Tom de Vries * gdb.fortran/info-types.exp: Fix gdb_test regexp to allow more diverse debug info. * lib/fortran.exp (fortran_int8): New proc, based on fortran_int4. --- gdb/testsuite/gdb.fortran/info-types.exp | 11 +++++++---- gdb/testsuite/lib/fortran.exp | 12 ++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.fortran/info-types.exp b/gdb/testsuite/gdb.fortran/info-types.exp index 81e67395e8..30646287ee 100644 --- a/gdb/testsuite/gdb.fortran/info-types.exp +++ b/gdb/testsuite/gdb.fortran/info-types.exp @@ -31,6 +31,7 @@ if { ![runto MAIN__] } { } set integer4 [fortran_int4] +set integer8 [fortran_int8] set logical4 [fortran_logical4] set character1 [fortran_character1] @@ -41,7 +42,9 @@ gdb_test "info types" \ "File .*:" \ "\[\t \]+${character1}" \ "\[\t \]+${integer4}" \ - "\[\t \]+${logical4}" \ - "20:\[\t \]+Type __vtype_mod1_M1t1;" \ - "17:\[\t \]+Type m1t1;" \ - "22:\[\t \]+Type s1;" ] + "(\[\t \]+${integer8}" \ + ")?\[\t \]+${logical4}" \ + "(20:\[\t \]+Type __vtype_mod1_M1t1;" \ + ")?$decimal:\[\t \]+Type m1t1;" \ + "22:\[\t \]+Type s1;(" \ + ".*)?"] diff --git a/gdb/testsuite/lib/fortran.exp b/gdb/testsuite/lib/fortran.exp index 81811dbc3c..d523608807 100644 --- a/gdb/testsuite/lib/fortran.exp +++ b/gdb/testsuite/lib/fortran.exp @@ -41,6 +41,18 @@ proc fortran_int4 {} { } } +proc fortran_int8 {} { + if {[test_compiler_info {gcc-4-[012]-*}]} { + return "int8" + } elseif {[test_compiler_info {gcc-*}]} { + return "integer\\(kind=8\\)" + } elseif {[test_compiler_info {icc-*}]} { + return "INTEGER\\(8\\)" + } else { + return "unknown" + } +} + proc fortran_real4 {} { if {[test_compiler_info {gcc-4-[012]-*}]} { return "real4"