This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 1/2] Make line tables independent of progspace


On 2018-03-28 01:02 AM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]