Re: [patch] Speed up find_pc_section

Tom Tromey
2009-07-17T15:07:00Z

>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:

Paul> Attached patch turns linear search into binary search, speeding up
Paul> find_pc_section drastically :-)

I love patches like this.

Paul> +static int objfiles_updated_p;

This (plus the map itself) seems like another thing that will have to be
per-inferior or per-address-space. But, perhaps we aren't quite ready
for that yet.

Paul> + objfiles_updated_p += 1; /* Rebuild section map next time we need it. */

It seems like we would need one of these in objfile_relocate, and maybe
in reread_symbols. What do you think?

Paul> +/* Bsearch comparison function. */
Paul> +
Paul> +int
Paul> +find_pc_section_cmp (const void *key, const void *elt)

Should be static.

Tom