From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114482 invoked by alias); 26 May 2018 01:25:05 -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 114228 invoked by uid 89); 26 May 2018 01:25:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=ordinary X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 26 May 2018 01:25:00 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w4Q1OsBb001555 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 25 May 2018 21:24:59 -0400 Received: by simark.ca (Postfix, from userid 112) id 3EE651F21C; Fri, 25 May 2018 21:24:54 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 1448A1E481; Fri, 25 May 2018 21:24:53 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 27 May 2018 03:57:00 -0000 From: Simon Marchi To: Weimin Pan Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Removing lookup_minimal_symbol_and_objfile In-Reply-To: <1526343059-25143-1-git-send-email-weimin.pan@oracle.com> References: <1526343059-25143-1-git-send-email-weimin.pan@oracle.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 26 May 2018 01:24:54 +0000 X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00710.txt.bz2 On 2018-05-14 20:10, Weimin Pan wrote: > Removing lookup_minimal_symbol_and_objfile and replacing it with > lookup_bound_minimal_symbol. lookup_minimal_symbol_and_objfile > only searches ordinary hash table for the minimal symbol entry > while lookup_bound_minimal_symbol does both ordinary hash table > and demangled hash table for the entry. > > Tested in both aarch64-linux-gnu and amd64-linux-gnu. No regressions. Hi Weimin, Thanks for the patch, the code looks good. But I think the commit log is misleading. The point is that lookup_minimal_symbol_and_objfile iterates on all objfiles and calls lookup_minimal_symbol for each of them, effectively searching in all objfiles. lookup_bound_minimal_symbol calls lookup_minimal_symbol with NULL, which also effectively searches all objfiles. AFAIK, they do exactly the same thing, so we can get rid of one (and lookup_minimal_symbol_and_objfile happens to be the most inefficient because it ends up n^2 on the number of objfiles). If you are fine with this correction, please push with the commit log adjusted. Simon