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:

> > If you're going to reset only breakpoints
> > from one objfile, maybe you should likewise *delete* only breakpoints
> > from that objfile?
> 
> That sounds like a good approach :-)
> 
> Patch below tested on Linux/x86_64 with no new failures.

Thanks for the quick reply!

> Unfortunately I don't have any targets that support overlays, so I can't
> test this. Did this fail for you on spu? If so, does it pass with this patch?

Unfortunately, I don't have a ready test case, I noticed the problem
while reading the code ...  Mainline GDB does not yet support combined
Cell/B.E. debugging, and stand-alone SPU executables are always statically
linked so I'm never seeing more than one objfile anyway.

In any case, I don't think your patch fixes the problem in the case
where more than one objfile defines _ovly_debug_event:

> +    case bp_overlay_event:
> +      if (objfile == NULL
> +          || lookup_minimal_symbol_text (b->addr_string, objfile))
> +        {
> +          /* Delete overlay event breakpoints; they will be reset later by
> +             breakpoint_re_set.  */
> +          delete_breakpoint (b);
> +        }
> +      break;

If objfile actually defines _ovly_debug_event, the symbol lookup will
succeed for *all* bp_overlay_event breakpoints, as they all use the
same addr_string, and thus all breakpoints will be deleted.  But again,
only one of them will get re-inserted ...

I guess you'd have to verify that not only symbol lookup succeeded, but
it results in the address used to set this breakpoint.  But that's not
really correct either, because breakpoint_re_set may get called after
an objfile has been relocated.

In fact, I don't really see an easy way to identify the originating
objfile just from looking at the breakpoint.  Maybe we could set addr_string
to some string that uniquely identifies the objfile when creating the
breakpoint?  It isn't really used for a lot else for bp_overlay_event
breakpoints (except for the maint info breakpoint output).

Bye,
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]