summaryrefslogtreecommitdiff
path: root/gdb/ChangeLog-1994
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-15 09:54:44 -0700
committerSimon Marchi <simon.marchi@efficios.com>2020-05-12 15:24:51 -0400
commitdd787f5e654f0390cf388e412b5921163b94f1a7 (patch)
treea177736d42305fbb89f1d833c8393daf6bdeea9d /gdb/ChangeLog-1994
parentfb113f4f48482171dffd287b2bdb71a6c7e20797 (diff)
downloadbinutils-gdb-users/simark/submit/share-dwarf-partial-symtabs-v2.tar.gz
This changes the DWARF reader to share partial symtabs (or indices if they are available) across objfiles. This has a few parts. * If multiple objfiles backed by the same BFD can share partial symtabs (see below), a single dwarf2_per_bfd is created. It is stored in the per-bfd `dwarf2_per_bfd_bfd_data_key` registry. Multiple dwarf2_per_objfile objects will point to the same instance. The lifetime of these dwarf2_per_bfd objects is naturally handled. When all the objfiles using the BFD are destroyed, the BFD's refount drops to 0, which triggers the removal of the corresponding dwarf2_per_bfd object from the registry and its destruction. * If multiple objfiles backed by the same BFD can't share partial symtabs (see below), one dwarf2_per_bfd object is created for each objfile. Each dwarf2_per_objfile will point to their own instance of dwarf2_per_bfd. These instances of dwarf2_per_bfd are kept in a per-objfile registry, meaning that when the objfile gets destroyed, the dwarf2_per_bfd instance gets destroyed as well. * objfile::partial_symtabs is changed to be a shared_ptr again. This lets us stash a second reference in dwarf2_per_bfd; if the DWARF data is being shared, we can simply copy this value to the new objfile. * Two dwarf2_per_objfile objects backed by the same BFD may share a dwarf2_per_bfd instance if: * No other symbol reader has found symbols, and * No BFD section rqeuires relocation YYYY-MM-DD Tom Tromey <tom@tromey.com> YYYY-MM-DD Simon Marchi <simon.marchi@efficios.com> * objfiles.h (struct objfile) <partial_symtabs>: Now a shared_ptr. * dwarf2/read.h (struct dwarf2_per_objfile) <partial_symtabs>: New member. * dwarf2/read.c (dwarf2_per_bfd_bfd_data_key, dwarf2_per_bfd_objfile_data_key>: New globals. (dwarf2_has_info): Use shared dwarf2_per_bfd if possible. (dwarf2_get_section_info): Use get_dwarf2_per_objfile. (dwarf2_initialize_objfile): Consider cases where per_bfd can be shared. (dwarf2_build_psymtabs): Set objfile::partial_symtabs and short-circuit when sharing. (dwarf2_build_psymtabs): Set dwarf2_per_objfile::partial_symtabs. (dwarf2_psymtab::expand_psymtab): Use free_cached_comp_units.
Diffstat (limited to 'gdb/ChangeLog-1994')
0 files changed, 0 insertions, 0 deletions