From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56105 invoked by alias); 28 Aug 2019 12:37:27 -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 56095 invoked by uid 89); 28 Aug 2019 12:37:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f68.google.com Received: from mail-wm1-f68.google.com (HELO mail-wm1-f68.google.com) (209.85.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Aug 2019 12:37:26 +0000 Received: by mail-wm1-f68.google.com with SMTP id t17so1619340wmi.2 for ; Wed, 28 Aug 2019 05:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=h8Y//7WYmCLUST7GhrxUaN9+nMtlPQ+AzplvCuJJDmg=; b=OlU7KDlzIq8bFEeXilQ06PDtcXis8l5W3AQIG+TKmcRlKPU9Seg6JDwZ4FkxfUTwbW jcEipdd0epnhzc69WTAnGWD0Z3GDz52Sbg6Ot8d5GLlv1pG7lGNqIwLjhcfMftWAhUSX +lzGthyhtag70fUsKBTHJkMTukPdo0h77QEzT17OTICQMDGp9lSn5CHGwd7WmKvwdZjK g+4QryMUqtWiDvGfac8Cv04SzhkJnnMjZTZw6ot2CtjvdzEk+wk4v7vraQinRIyDTG5O mrP5udshatR0Wkal93pO3U3+IIiQ2H1mKu2aWt8ZLDVNddz15X34U0aYq04ojSkVEnzC yAdw== Return-Path: Received: from localhost (host86-161-16-231.range86-161.btcentralplus.com. [86.161.16.231]) by smtp.gmail.com with ESMTPSA id j16sm1592506wrp.62.2019.08.28.05.37.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Aug 2019 05:37:23 -0700 (PDT) Date: Wed, 28 Aug 2019 12:37:00 -0000 From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Richard Bunt Subject: Re: [PATCH 5/7] gdb/fortran: Don't include module symbols when searching for types Message-ID: <20190828123722.GW6076@embecosm.com> References: <5184ae288c08432d0e873fd48b8c56619e3d2699.1564243858.git.andrew.burgess@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5184ae288c08432d0e873fd48b8c56619e3d2699.1564243858.git.andrew.burgess@embecosm.com> X-Fortune: The moving cursor writes, and having written, blinks on. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00633.txt.bz2 * 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. Thanks, Andrew > --- > gdb/ChangeLog | 5 +++++ > gdb/symtab.c | 3 ++- > gdb/testsuite/ChangeLog | 5 +++++ > gdb/testsuite/gdb.fortran/info-types.exp | 4 +++- > gdb/testsuite/gdb.fortran/info-types.f90 | 11 +++++++++++ > 5 files changed, 26 insertions(+), 2 deletions(-) > > diff --git a/gdb/symtab.c b/gdb/symtab.c > index 84038d15dff..d3a209608b7 100644 > --- a/gdb/symtab.c > +++ b/gdb/symtab.c > @@ -4539,7 +4539,8 @@ search_symbols (const char *regexp, enum search_domain kind, > || treg_matches_sym_type_name (*treg, > sym))) > || (kind == TYPES_DOMAIN > - && SYMBOL_CLASS (sym) == LOC_TYPEDEF)))) > + && SYMBOL_CLASS (sym) == LOC_TYPEDEF > + && SYMBOL_DOMAIN (sym) != MODULE_DOMAIN)))) > { > /* match */ > result.emplace_back (i, sym); > diff --git a/gdb/testsuite/gdb.fortran/info-types.exp b/gdb/testsuite/gdb.fortran/info-types.exp > index 9571dc45593..81e67395e8a 100644 > --- a/gdb/testsuite/gdb.fortran/info-types.exp > +++ b/gdb/testsuite/gdb.fortran/info-types.exp > @@ -42,4 +42,6 @@ gdb_test "info types" \ > "\[\t \]+${character1}" \ > "\[\t \]+${integer4}" \ > "\[\t \]+${logical4}" \ > - "16:\[\t \]+Type s1;" ] > + "20:\[\t \]+Type __vtype_mod1_M1t1;" \ > + "17:\[\t \]+Type m1t1;" \ > + "22:\[\t \]+Type s1;" ] > diff --git a/gdb/testsuite/gdb.fortran/info-types.f90 b/gdb/testsuite/gdb.fortran/info-types.f90 > index 21c9d9df63c..0e27e1ddf08 100644 > --- a/gdb/testsuite/gdb.fortran/info-types.f90 > +++ b/gdb/testsuite/gdb.fortran/info-types.f90 > @@ -13,13 +13,24 @@ > ! You should have received a copy of the GNU General Public License > ! along with this program. If not, see . > > +module mod1 > + type :: m1t1 > + integer :: b > + end type m1t1 > +end module mod1 > + > program info_types_test > + use mod1 > + > type :: s1 > integer :: a > end type s1 > > logical :: l > type (s1) :: var_a > + type (m1t1) :: var_b > + > var_a%a = 1 > + var_b%b = 2 > l = .FALSE. > end program info_types_test > -- > 2.14.5 >