A long-term goal for multi-inferior debugging has been to "split" an
objfile, so that the bulk of the data can be shared across inferiors.
Although a lot of progress has been made on this front, it has turned
out to be surprisingly difficult to fully implement.
"Recently" (a year or two ago) I realized that we could get most of
the benefits of this split by sharing partial symbol tables. This is
true because reading partial symbols is the slowest operation that
users see -- in most cases, expanding a full symtab is reasonably
quick.
Implementing this also turned out to be tricky; but unlike the
situation with types and symbols, it was possible to do incrementally.
This series implements this idea for DWARF. It separates
dwarf2_per_objfile into shareable and unshareable parts; then, when
possible, the object is attached to the BFD.
You can see the difference when timing "add-inferior -exec ./gdb",
after "gdb ./gdb":