This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Speed up find_pc_section
- From: Tom Tromey <tromey at redhat dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Fri, 17 Jul 2009 09:06:46 -0600
- Subject: Re: [patch] Speed up find_pc_section
- References: <8ac60eac0907161724v40e5bd8bg7877d8901b8d7b6e@mail.gmail.com>
- Reply-to: tromey at redhat dot com
>>>>> "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