[binutils-gdb] [gdb/symtab] Revert "Add assert in free_cached_comp_units constructor"
Tom de Vries via Gdb-cvs <[email protected]> Sat, 30 May 2026 12:50:20 +0000 (GMT)
| Newsgroups | gmane.comp.gdb.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=92310a6d52cc3eb8a88246f6c3d6ec668e2425b3 commit 92310a6d52cc3eb8a88246f6c3d6ec668e2425b3 Author: Tom de Vries <[email protected]> Date: Sat May 30 14:50:16 2026 +0200 [gdb/symtab] Revert "Add assert in free_cached_comp_units constructor" This reverts commit b083976272bd663ed036692e54796870b3bf6c89. The new assert triggers in test-cases gdb.ada/uninitialized-variable-record.exp and gdb.ada/uninitialized_vars.exp on x86_64-linux. Diff: --- gdb/dwarf2/read.c | 3 --- gdb/dwarf2/read.h | 6 ------ 2 files changed, 9 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 0d313f62f4a..742be7656b1 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -902,9 +902,6 @@ public: explicit free_cached_comp_units (dwarf2_per_objfile *per_objfile) : m_per_objfile (per_objfile) { - /* The destructor frees all cached comp units, including ones currently - cached, so check that there are no currently cached comp units. */ - gdb_assert (m_per_objfile->nr_of_cus () == 0); } ~free_cached_comp_units () diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 603fe089d6a..15dd2abf3a1 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -969,12 +969,6 @@ struct dwarf2_per_objfile /* Free all cached compilation units. */ void remove_all_cus (); - /* Return the number of cached compilation units. */ - size_t nr_of_cus () const - { - return m_dwarf2_cus.size (); - } - /* Increase the age counter on each CU compilation unit and free any that are too old. */ void age_comp_units ();