From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27447 invoked by alias); 30 Oct 2018 14:59:02 -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 27420 invoked by uid 89); 30 Oct 2018 14:59:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=BAYES_00,KAM_STOCKGEN,SPF_PASS autolearn=no version=3.3.2 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; Tue, 30 Oct 2018 14:59:00 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8C4DDB0F8; Tue, 30 Oct 2018 14:58:58 +0000 (UTC) Subject: Re: [PUSHED 2/5] Add [-q] [-t TYPEREGEXP] [NAMEREGEXP] args to info [args|functions|locals|variables] To: Philippe Waroquiers , gdb-patches@sourceware.org References: <20181027124418.20394-1-philippe.waroquiers@skynet.be> <20181027124418.20394-3-philippe.waroquiers@skynet.be> From: Tom de Vries Cc: Pedro Alves Message-ID: Date: Tue, 30 Oct 2018 14:59:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181027124418.20394-3-philippe.waroquiers@skynet.be> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00711.txt.bz2 On 10/27/18 2:44 PM, Philippe Waroquiers wrote: > @@ -4497,8 +4560,13 @@ search_symbols (const char *regexp, enum search_domain kind, > || MSYMBOL_TYPE (msymbol) == ourtype3 > || MSYMBOL_TYPE (msymbol) == ourtype4) > { > - if (!preg || preg->exec (MSYMBOL_NATURAL_NAME (msymbol), 0, > - NULL, 0) == 0) > + /* If the user wants to see var matching a type regexp, > + then never give a minimal symbol. */ > + if (kind != VARIABLES_DOMAIN > + && !treg.has_value () /* minimal symbol has never a type ???? */ > + && (!preg.has_value () > + || preg->exec (MSYMBOL_NATURAL_NAME (msymbol), 0, > + NULL, 0) == 0)) > { > /* For functions we can do a quick check of whether the > symbol might be found via find_pc_symtab. */ Hi, Consider this testcase with minimal symbols: ... $ cat test.c static int var; int main (void) { return 0; } $ gcc test.c $ ... After this commit, I don't see "var": ... $ gdb -batch a.out -ex "info var" All defined variables: File init.c: 24: const int _IO_stdin_used; ... while before this commit, I do see "var": ... $ gdb -batch a.out -ex "info variables" All defined variables: File init.c: 24: const int _IO_stdin_used; Non-debugging symbols: 0x0000000000400534 __GNU_EH_FRAME_HDR 0x0000000000400624 __FRAME_END__ 0x0000000000600e40 __frame_dummy_init_array_entry 0x0000000000600e40 __init_array_start 0x0000000000600e48 __do_global_dtors_aux_fini_array_entry 0x0000000000600e48 __init_array_end 0x0000000000600e50 _DYNAMIC 0x0000000000601000 _GLOBAL_OFFSET_TABLE_ 0x0000000000601018 __data_start 0x0000000000601018 data_start 0x0000000000601020 __dso_handle 0x0000000000601028 __TMC_END__ 0x0000000000601028 __bss_start 0x0000000000601028 _edata 0x0000000000601028 completed 0x000000000060102c var 0x0000000000601030 _end ... I think this is a regression. Thanks, - Tom