diff options
author | Tom Tromey <tom@tromey.com> | 2021-05-30 08:50:57 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-05-30 19:44:05 -0600 |
commit | cc653233da3f9dade8b95be9a7286b95727408d6 (patch) | |
tree | 41db647197b72d9681fa241c12fc6507c44f9745 | |
parent | c96e8b04d3a8ef41843c7d3fa093b50b597dc7e0 (diff) | |
download | gdb-cc653233da3f9dade8b95be9a7286b95727408d6.zip gdb-cc653233da3f9dade8b95be9a7286b95727408d6.tar.gz gdb-cc653233da3f9dade8b95be9a7286b95727408d6.tar.bz2 |
Set is_debug_types in allocate_signatured_type
All callers of allocate_signatured_type set the is_debug_types flag on
the result -- in fact, they are required to, because this is the sign
that downcasting the object to signatured_type is safe. This patch
moves this assignment into the allocation function.
2021-05-30 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dwarf2_per_bfd::allocate_signatured_type): Set
is_debug_types.
(create_signatured_type_table_from_index)
(create_signatured_type_table_from_debug_names, add_type_unit)
(read_comp_units_from_section): Update.
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/dwarf2/read.c | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ecec841..7f52c28 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2021-05-30 Tom Tromey <tom@tromey.com> + * dwarf2/read.c (dwarf2_per_bfd::allocate_signatured_type): Set + is_debug_types. + (create_signatured_type_table_from_index) + (create_signatured_type_table_from_debug_names, add_type_unit) + (read_comp_units_from_section): Update. + +2021-05-30 Tom Tromey <tom@tromey.com> + * dwarf2/read.h (struct dwarf2_per_bfd) <num_psymtabs, m_num_psymtabs>: Remove. (resize_symtabs): Update. diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6da3124..9e5c3af 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -2300,6 +2300,7 @@ dwarf2_per_bfd::allocate_signatured_type () std::unique_ptr<signatured_type> result (new signatured_type); result->per_bfd = this; result->index = all_comp_units.size (); + result->is_debug_types = true; tu_stats.nr_tus++; return result; } @@ -2398,7 +2399,6 @@ create_signatured_type_table_from_index sig_type = per_bfd->allocate_signatured_type (); sig_type->signature = signature; sig_type->type_offset_in_tu = type_offset_in_tu; - sig_type->is_debug_types = 1; sig_type->section = section; sig_type->sect_off = sect_off; sig_type->v.quick @@ -2450,7 +2450,6 @@ create_signatured_type_table_from_debug_names sig_type = per_objfile->per_bfd->allocate_signatured_type (); sig_type->signature = cu_header.signature; sig_type->type_offset_in_tu = cu_header.type_cu_offset_in_tu; - sig_type->is_debug_types = 1; sig_type->section = section; sig_type->sect_off = sect_off; sig_type->v.quick @@ -5896,7 +5895,6 @@ add_type_unit (dwarf2_per_objfile *per_objfile, ULONGEST sig, void **slot) per_objfile->per_bfd->all_comp_units.emplace_back (sig_type_holder.release ()); sig_type->signature = sig; - sig_type->is_debug_types = 1; if (per_objfile->per_bfd->using_index) { sig_type->v.quick = @@ -7500,7 +7498,6 @@ read_comp_units_from_section (dwarf2_per_objfile *per_objfile, hex_string (sig_ptr->signature)); *slot = sig_ptr; } - this_cu->is_debug_types = (cu_header.unit_type == DW_UT_type); this_cu->sect_off = sect_off; this_cu->length = cu_header.length + cu_header.initial_length_size; this_cu->is_dwz = is_dwz; |