[RFA,00/15] Work toward making psymtabs reusable

Message ID 20180510222357.27332-1-tom@tromey.com
Headers show
Series
  • Work toward making psymtabs reusable
Related show

Message

Tom Tromey May 10, 2018, 10:23 p.m.
Recently I realized that, while the full objfile splitting project is
still a good idea, many of the potential gains from it could be had
more immediately -- by making psymtabs shareable across objfiles.

The idea behind this is that scanning psymbols is what is noticeably
slow; expanding a given CU is ordinarily pretty fast.  So, if psymbols
could be shared, then the most user-visible slowdown could be avoided,
at least in the multi-inferior case.

As an aside, this case matters to me, because Firefox is now
multi-process by default and each process uses the enormous libxul.so.
Multi-inferior debugging still has a ways to go in gdb, but if you are
working in this area, rest assured that there are people who want to
use the results...

This series does not actually achieve the goal of sharing psymbols.
It is just a bunch of necessary-but-not-sufficient infrastructure.  I
figured I would send it as it is relatively self-contained and already
pretty long.

Also note that it is built on top of my earlier series to make
psymbols independent of the program space.

This series begins (patches 1-7) with some minor cleanups that I found
while working in this area.  Perhaps patches 6 and 7 aren't really
needed; I wrote them when working toward a slightly different end
goal, but I think they are reasonable so I left them in.

Patch 8 is perhaps the ugliest of the bunch.  Because backlinks from
pymtabs to per-objfile objects will be disallowed, the
psymtab->compunit_symtab link had to be broken.  This patch does so
via a map.

The rest, I think, is reasonably straightforward.  Various
psymtab-related objects are moved to a new psymtab state-holding
object, and finally, this object is given its own obstack, moving the
psymbols into a shareable object.

This is the series I referenced in reply to Simon's auto-indexing
series -- I think with this it is pretty easy to picturing handing the
psymtab_storage shared_ptr to a separate thread to write out the index
file.

Regression tested by the buildbot.

There are still some remaining cleanups that could be done.  psymtab.c
uses ALL_OBJFILE_PSYMTABS_REQUIRED everywhere, but in some spots it
doesn't make sense.  Also, ~objfile (indirectly) calls
psym_forget_cached_source_info, but really psymtab_storage should be
handling this in its own destructor.

Tom

Comments

Tom Tromey June 18, 2018, 2:42 p.m. | #1
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:


Tom> Recently I realized that, while the full objfile splitting project is
Tom> still a good idea, many of the potential gains from it could be had
Tom> more immediately -- by making psymtabs shareable across objfiles.

[...]

Ping.

Tom
Tom Tromey July 16, 2018, 4:32 p.m. | #2
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:


>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> Recently I realized that, while the full objfile splitting project is
Tom> still a good idea, many of the potential gains from it could be had
Tom> more immediately -- by making psymtabs shareable across objfiles.

Tom> [...]

Tom> Ping.

Ping.

Tom