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: [00/19] Eliminate some more current_gdbarch uses


Pedro Alves wrote:

> I *know* we can do smarter, but exactly what's the best, I haven't
> thought much about.  Some data points / suggestions:
> 
>  - longjmp breakpoints need to be installed as long as there's a
>    thread nexting or stepping or whatever command that needs those,
>    for non-stop mode.  The fact that they're momentary breakpoints
>    makes it so that a thread that is "continue"ing, simply thread
>    hops them, since momentary breakpoints are thread specific, which is
>    more efficient than having them all
>    set longjmp-resume, hit-longjmp-resume,resume.  The breakpoint location
>    machinery takes care of not installing duplicates.  The set of addresses
>    where to install such breakpoints however, don't change per-address
>    space --- we could cache minimal symbols on a per symbol/address space
>    generic framework (similar to objfile_data), and reparse that only when
>    symbols change (that is, breakpoint_re_set or similar).
> 
>  - perhaps the simplest and most likely the most effective easily: we
>    can use the objfile_data mechanism to cache if there are longjmp-like
>    functions in a given objfile.  No use looking up the minimal symbol
>    everytime.

I guess we could treat the longjmp breakpoint similarly to the
overlay event breakpoint and recompute its address(es) only when
objfiles change (i.e. in breakpoint_re_set_objfile).

Of course, this would mean the breakpoints were always active.  However,
this could be improved upon by:
- having infrun ignore longjmp breakpoints if not stepping
- keeping them disabled unless stepping (and still have infrun ignore
  longjmp breakpoints when hit in the wrong thread)
and/or
- keeping them always disabled, but installing momentary clones in
  threads that are stepping

>  - lookup_minimal_symbol still does a linear walk on all objfiles
>    when you pass it an objfile.  That may matter a bit.  We could
>    split that function in two to not do that loop when we know the
>    objfile in advance.

This might be useful anyway ...

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]