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: [rfc][patch] Eliminate quadratic slow-down on number of solibs.


Paul Pluzhnikov wrote:

> >> I also verified that create_overlay_event_breakpoint is not called for
> >> each solib (though it is called 7 times, which seems like 6 too many).
> >
> > Hmm, do you understand where the other calls come from?
> 
> I've attached a log (to avoid GMail line wrapping): 4 calls at startup,
> 3 more when all the solibs are loaded. I haven't debugged the exact reason;
> in my reading of the code it should only fire once after all solibs.

So from these backtraces it looks like the calls on startup are:

- one call after the main executable is loaded

- one call in solib_add after all the directly linked shared libraries
  are loaded

- one extra call in post_create_inferior:

    /* If the user sets watchpoints before execution having started,
     then she gets software watchpoints, because GDB can't know which
     target will end up being pushed, or if it supports hardware
     watchpoints or not.  breakpoint_re_set takes care of promoting
     watchpoints to hardware watchpoints if possible, however, if this
     new inferior doesn't load shared libraries or we don't pull in
     symbols from any other source on this target/arch,
     breakpoint_re_set is never called.  Call it now so that software
     watchpoints get a chance to be promoted to hardware watchpoints
     if the now pushed target supports hardware watchpoints.  */

- and finally one more call after the "magic" vsyscall solib is installed
  (from add_vsyscall_page)

I guess some of those could get removed by some more restructuring of the
code, but I'm not sure this is worth the effort.


The three subsequent calls all come from solib_add, presumably as more
shared libraries are loaded via dlopen?  If so, there's again probably
not a lot we can do about that.


> 2009-06-22  Paul Pluzhnikov  <ppluzhnikov@google.com>
> 
> 	Revert 2009-05-14 breakpoint commit (no longer needed).
> 	* breakpoint.h (breakpoint_re_set_objfile): Remove
> 	* breakpoint.c (breakpoint_re_set_objfile): Likewise
> 	(create_overlay_event_breakpoint): Remove objfile parameter,
> 	iterate over all objfiles.
> 	* objfiles.c (objfile_relocate): Update.
> 	* symfile.c (new_symfile_objfile): Likewise.

This is OK.

Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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