Split type_unit_group
authorTom Tromey <tom@tromey.com>
Wed, 27 May 2020 15:19:09 +0000 (11:19 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 27 May 2020 15:19:09 +0000 (11:19 -0400)
commit8adb84872b7b039c70f5448f6cf5fe7dfc79d367
tree22530bcf3ab77062a35551b3d5dfbd697e8c8f95
parent127bbf4b50c31b75b9d4c0ecc6b014dbd7ec38f9
Split type_unit_group

type_unit_group has links to the compunit_symtab and other symtabs.
However, once this object is shared across objfiles, this will no
longer be ok.

This patch introduces a new type_unit_group_unshareable and arranges to
store a map from type unit groups to type_unit_group_unshareable objects
in dwarf2_per_objfile.

gdb/ChangeLog:

YYYY-MM-DD  Tom Tromey  <tom@tromey.com>
YYYY-MM-DD  Simon Marchi  <simon.marchi@efficios.com>

* dwarf2/read.h (struct type_unit_group_unshareable): New.
(struct dwarf2_per_objfile) <type_units>: New member.
<get_type_unit_group_unshareable>: New method.
* dwarf2/read.c (struct type_unit_group) <compunit_symtab,
num_symtabs, symtabs>: Remove; move to
type_unit_group_unshareable.
(dwarf2_per_objfile::get_type_unit_group_unshareable): New.
(process_full_type_unit, dwarf2_cu::setup_type_unit_groups)
(dwarf2_cu::setup_type_unit_groups): Use type_unit_group_unshareable.

Change-Id: I1fec2fab59e0ec40fee3614fc821172a469c0e41
gdb/ChangeLog
gdb/dwarf2/read.c
gdb/dwarf2/read.h