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: [patch] Speed up find_pc_section


On Tue, Jul 21, 2009 at 9:06 AM, Tom Tromey<tromey@redhat.com> wrote:

> Paul> I moved the 'objfiles_updated_p += 1' from free_objfile() into
> Paul> clear_objfile_data() -- that's called from reread_symbols() as well.
>
> I don't like this so much. clear_objfile_data is a clear,
> single-purpose function. I'm reluctant to add unrelated code to it.
>
> Perhaps a new function would be better. Or, maybe there is a way to do
> this by registering some observers.

Good call.
I added observers and removed all other places where the flag was set.

> Paul> 2009-07-17 ?Paul Pluzhnikov ?<ppluzhnikov@google.com>
...
> This should mention the modified functions: add_to_objfile_sections,
> objfile_relocate, and clear_objfile_data.

No longer applicable.

> +  objfiles_updated_p += 1;  /* Rebuild section map next time we need it.  */
>
> Since this is just a boolean flag I think a plain assignment is clearer.

Done.

Re-tested on Linux/x86_64 with no new failures.

Thanks,
-- 
Paul Pluzhnikov

2009-07-21  Paul Pluzhnikov  <ppluzhnikov@google.com>

	* objfiles.c (objfiles_updated_p): New variable.
	(qsort_cmp, bsearch_cmp, update_section_map): New function.
	(find_pc_section): Use bsearch.
	(set_objfiles_updated_on_exe_change): New function.
	(set_objfiles_updated_on_solib_activity): New function.
	(_initialize_objfiles): New function.

Attachment: gdb-find_pc_section-20090721.txt
Description: Text document


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