From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128759 invoked by alias); 28 Mar 2018 12:32:36 -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 128090 invoked by uid 89); 28 Mar 2018 12:32:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Mar 2018 12:32:34 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 404281E4B2; Wed, 28 Mar 2018 08:32:33 -0400 (EDT) Subject: Re: [RFA 1/2] Make line tables independent of progspace To: Tom Tromey Cc: gdb-patches@sourceware.org, macro@mips.com References: <20180321171809.13115-1-tom@tromey.com> <20180321171809.13115-2-tom@tromey.com> <87zi2uw3uc.fsf@tromey.com> <87vadiw24a.fsf@tromey.com> <87muysx06b.fsf@tromey.com> From: Simon Marchi Message-ID: Date: Wed, 28 Mar 2018 12:32:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <87muysx06b.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-03/txt/msg00586.txt.bz2 On 2018-03-28 01:02 AM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > >>> + auto pc_compare = [=](const CORE_ADDR & pc, >>> + const struct linetable_entry & lhs)->bool >>> { >>> - return pc < lhs.pc; >>> + return pc < lhs.address (iter_s); >>> }; > > Simon> Since we know this will be called many times and address() is substantially > Simon> more costly than just reading a CORE_ADDR field, maybe it would be good to > Simon> save it to a variable before and use that in the lambda. > > I am not sure this would work, because LHS is what changes here -- > std::upper_bound is searching through the line table looking for a > match. > > One idea might be to "unrelocate" PC to do the search. This would make > the search more efficient. I will try this. Ah sorry, you are right. Simon