This is the mail archive of the gdb-prs@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]

[Bug breakpoints/14340] rbreak inefficiency


http://sourceware.org/bugzilla/show_bug.cgi?id=14340

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2012-07-09 19:32:25 UTC ---
(In reply to comment #0)
> rbreak_command first calls search_symbols to collect the list of symbols that
> match the regexp (or file:regexp).  It then loops over each found symbol
> calling, essentially, "break file:function" which in turn causes gdb to loop
> over all symtabs again, but this time for each symtab:symbol from the result of
> search_symbols.

There's also a further quadratic slowdown by checking for duplicate locations.
You can see it clearly if you "rbreak .*" on gdb itself.
I think this is a reasonable-enough scenario that it ought to work.

> Perhaps there's a reason why the code is the way it is, but it's odd that the
> result of search_symbols isn't sufficient.
> There's a massive speedup to be had by having a breakpoint API routine that
> takes a struct symbol as an argument.

Keith is working on something similar to this, though not identical.

Another approach would be to have rbreak create a single breakpoint with
a "regexp linespec" instead of having rbreak create multiple breakpoints.
Doing this efficiently would require the fine-grained breakpoint re-setting
work that we plan, but haven't yet done.

> [sidebar: it's odd that struct symbol_search records symtab even though one can
> get the symbol's symtab from struct symbol]

I wonder whether symbol::symtab was added later.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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