This is the mail archive of the 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: [commit] Improve performance with lots of shared libraries

On Wednesday 12 October 2011 16:59:18, Gary Benson wrote:
> Pedro Alves wrote:

> > To make this generic for all breakpoints/stops, what I have in mind
> > would be:
> > 
> >  - at breakpoint creation or re-set time, check if the locations
> >    we've created point at inlined code, and set a flag in the
> >    breakpoint's locations.  We know the location is inlined or not
> >    from the debug info.  Breakpoint creation is the slow path, so
> >    that's okay.
> > 
> >  - given that we need to single-step over those breakpoints, we also
> >    need to know whether the PC after stepping over those breakpoints
> >    points at inlined code.  I think we can still do that at
> >    breakpoint creation or re-set time.  We'd need to reuse the
> >    software single-step machinery to know where the single-step
> >    would take us, and record somewhere that those locations point to
> >    inline code or not.  We'd also check this list in
> >    stopped_at_non_inline_function.  The software single-step
> >    machinery would need some cleaning up to make this possible.
> >    It's interface, gdbarch_software_single_step, isn't fit for this.
> >    The gdbarch hook should return a list of locations where to put
> >    the breakpoint, instead of implementations planting the
> >    breakpoints themselves, which would be a nice cleanup for other
> >    things too.  We'd also need to implement this hook for x86.  It's
> >    not implemented currently because x86 can do hardware
> >    single-stepping.
> Ah, nice!  Would it be appropriate to file a bug containing this
> information?  So it doesn't get lost before I have a chance to work
> on it?

Sure!  What I haven't thought about much is whether this
optimization would be indeed a general win.  :-)  It'd make a
difference if you tend to have planted breakpoints that 
don't cause a stop often (e.g., some python breakpoint),
and maybe it'd make a difference on software single-step
targets, and a tiny bit on handling step-resume
breakpoints on hardware step targets?  I don't have a clear
picture where time is being spent (other than roundtripping
to the target).  Thread event breakpoints sound like low
hang fruit though.

Pedro Alves

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