[Bug symtab/27898] [gdb] Cannot not find DIE

vries at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Tue May 25 21:25:18 GMT 2021


https://sourceware.org/bugzilla/show_bug.cgi?id=27898

--- Comment #7 from Tom de Vries <vries at gcc dot gnu.org> ---
Hmm, so the sequence of events is as follows:
- we create a dwarf2_cu
- we create another dwarf2_cu for the same per_cu
- the second dwarf2_cu is set in per_objfile->m_dwarf2_cus.
- per_cu->load_all_dies is set to 1
- all dies are read into the partial_dies htab for the first dwarf2_cu
- the first dwarf2_cu is destroyed
- we try to find a partial_die in the partial_dies htab for the second
  dwarf2_cu.  We can't find it, but do not try to load all dies, because
  per_cu->load_all_dies is already set
- an error message is generated.

There is some code to prevent creating a second dwarf2_cu:
...
      cu = per_objfile->get_cu (per_cu);
      if (cu == NULL || cu->partial_dies == NULL)
        load_partial_comp_unit (per_cu, per_objfile, nullptr);
...
But get_cu only delivers a results after reader.keep() is done.  In this case,
the reader is still live, so it returns NULL.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list