diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 39f444e1f78..3154a8d0ed1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2021-05-27 Tom de Vries + + PR symtab/27898 + * dwarf2/cu.c (dwarf2_cu::dwarf2_cu): Add load_all_dies init. + * dwarf2/cu.h (dwarf2_cu): Add load_all_dies field. + * dwarf2/read.c (load_partial_dies, find_partial_die): Update. + * dwarf2/read.h (dwarf2_per_cu_data::dwarf2_per_cu_data): Remove + load_all_dies init. + (dwarf2_per_cu_data): Remove load_all_dies field. + 2021-05-26 Simon Marchi * regcache.c (reg_buffer::reg_buffer): Default-initialize diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c index 2451df4f5b6..1031ed3aa00 100644 --- a/gdb/dwarf2/cu.c +++ b/gdb/dwarf2/cu.c @@ -35,7 +35,8 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu, producer_is_icc (false), producer_is_icc_lt_14 (false), producer_is_codewarrior (false), - processing_has_namespace_info (false) + processing_has_namespace_info (false), + load_all_dies (false) { } diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h index ff56ec5527b..b4a5b08d5a6 100644 --- a/gdb/dwarf2/cu.h +++ b/gdb/dwarf2/cu.h @@ -264,6 +264,12 @@ struct dwarf2_cu bool processing_has_namespace_info : 1; + /* This flag will be set when reading partial DIEs if we need to load + absolutely all DIEs for this compilation unit, instead of just the ones + we think are interesting. It gets set if we look for a DIE in the + hash table and don't find it. */ + bool load_all_dies : 1; + struct partial_die_info *find_partial_die (sect_offset sect_off); /* If this CU was inherited by another CU (via specification, diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index d3b5b89c1c3..3f496347cce 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18817,7 +18817,7 @@ load_partial_dies (const struct die_reader_specs *reader, last_die = NULL; gdb_assert (cu->per_cu != NULL); - if (cu->per_cu->load_all_dies) + if (cu->load_all_dies) load_all = 1; cu->partial_dies @@ -19385,9 +19385,9 @@ find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) /* If we didn't find it, and not all dies have been loaded, load them all and try again. */ - if (pd == NULL && cu->per_cu->load_all_dies == 0) + if (pd == NULL && cu->load_all_dies == 0) { - cu->per_cu->load_all_dies = 1; + cu->load_all_dies = 1; /* This is nasty. When we reread the DIEs, somewhere up the call chain THIS_CU->cu may already be in use. So we can't just free it and diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 6af1f44bd47..0bb3da5a34a 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -421,7 +421,6 @@ struct dwarf2_per_cu_data { dwarf2_per_cu_data () : queued (false), - load_all_dies (false), is_debug_types (false), is_dwz (false), reading_dwo_directly (false), @@ -447,12 +446,6 @@ struct dwarf2_per_cu_data any of the current compilation units are processed. */ unsigned int queued : 1; - /* This flag will be set when reading partial DIEs if we need to load - absolutely all DIEs for this compilation unit, instead of just the ones - we think are interesting. It gets set if we look for a DIE in the - hash table and don't find it. */ - unsigned int load_all_dies : 1; - /* Non-zero if this CU is from .debug_types. Struct dwarf2_per_cu_data is contained in struct signatured_type iff this is non-zero. */