[patch] Speed up find_pc_section

Tom Tromey tromey@redhat.com
Fri Jul 17 16:27:00 GMT 2009


>>>>> "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



More information about the Gdb-patches mailing list