Re: [PATCH 00/14] Share DWARF partial symtabs between objfiles

Luis Machado
2020-02-17T12:31:26Z

On 2/15/20 1:54 PM, Tom Tromey wrote:
> 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":
>

Out of curiosity, what use cases would this cover? I imagine symbol data
could be shared, with a few exceptions, only with binaries that are
equal to the one we've already loaded/we're already debugging.

Is this a common scenario? Would type-sharing also be a common scenario?