From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85488 invoked by alias); 16 Nov 2018 18:28:35 -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 85455 invoked by uid 89); 16 Nov 2018 18:28:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 18:28:31 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F2412D7E0; Fri, 16 Nov 2018 18:28:30 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E4FC60BE5; Fri, 16 Nov 2018 18:28:29 +0000 (UTC) Subject: Re: [RFA 2/5] Use scoped_switch_auto_to_sym_language in symtab.c to switch language. To: Philippe Waroquiers , gdb-patches@sourceware.org References: <20181028144614.14149-1-philippe.waroquiers@skynet.be> <20181028144614.14149-3-philippe.waroquiers@skynet.be> From: Pedro Alves Message-ID: <5c4edf47-cdb1-640b-6127-f14842a9707d@redhat.com> Date: Fri, 16 Nov 2018 18:28:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181028144614.14149-3-philippe.waroquiers@skynet.be> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-11/txt/msg00257.txt.bz2 On 10/28/2018 02:46 PM, Philippe Waroquiers wrote: > Use scoped_switch_auto_to_sym_language in treg_matches_sym_type_name to > replace the local logic that was doing the same as the new class > scoped_switch_auto_to_sym_language. > > Use scoped_switch_auto_to_sym_language inside print_symbol_info, so > that symbol information is printed in the symbol language when > language mode is auto. > This modifies the behaviour of the test dw2-case-insensitive.exp, > as the function FUNC_lang is now printed with the Fortran syntax > (as declared in the .S file). > > + > > if (symbol_lookup_debug > 1) > { > @@ -4601,6 +4598,7 @@ print_symbol_info (enum search_domain kind, > struct symbol *sym, > int block, const char *last) > { > + scoped_switch_auto_to_sym_language l (sym); Sounds unnecessarily inefficient to use the scoped switch here instead of at the caller to avoid the back and forth for each symbol, but probably this isn't in any hot path, so it's fine. > struct symtab *s = symbol_symtab (sym); > > if (last != NULL) > diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp > index b15dcafa00..2e3397865a 100644 > --- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp > +++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp > @@ -42,8 +42,10 @@ gdb_test "info functions fUnC_lang" \ > gdb_test "set case-sensitive off" {warning: the current case sensitivity setting does not match the language\.} > > # The dot-leading symbol is for ppc64 function descriptors. > +# Note that info functions gives the FUNC_lang result using the fortran syntax > +# as specific in dw-case-insensitive-debug.S DW_AT_language. > gdb_test "info functions fUnC_lang" \ > - "All functions matching regular expression \"fUnC_lang\":\[\r\n\]+File file1.txt:\r\n\tfoo FUNC_lang\\(void\\);(\r\n\r\nNon-debugging symbols:\r\n0x\[0-9a-f\]+ +\\.FUNC_lang)?" \ > + "All functions matching regular expression \"fUnC_lang\":\[\r\n\]+File file1.txt:\r\n\tfoo FUNC_lang\\(\\);(\r\n\r\nNon-debugging symbols:\r\n0x\[0-9a-f\]+ +\\.FUNC_lang)?" \ > "regexp case-sensitive off" OOC, the actual name & type matching respect the symbol's language, right? Patch is OK. Thanks, Pedro Alves