This is the mail archive of the
mailing list for the GDB project.
Re: [00/19] Eliminate some more current_gdbarch uses
On Friday 05 June 2009 23:52:25, Tom Tromey wrote:
> >>>>> "Pedro" == Pedro Alves <firstname.lastname@example.org> writes:
> Pedro> - We should do something smarter about longjmp breakpoint
> Pedro> lookup at some point.
> If you have something in mind, I would like to hear it.
> The next-over-throw patch does something very similar to the longjmp
> code; I would be happy to update both at once.
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
- 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.
- we can move the update_global_location_list to the caller of
create_longjmp_breakpoint, cutting its frequency by 4, if that
matters. Probably not currently.