]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/symtab] Revert "Add assert in free_cached_comp_units constructor"
authorTom de Vries <tdevries@suse.de>
Sat, 30 May 2026 12:50:16 +0000 (14:50 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 30 May 2026 12:50:16 +0000 (14:50 +0200)
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.

gdb/dwarf2/read.c
gdb/dwarf2/read.h

index 0d313f62f4a13e0c53a4e2d0353171213447edea..742be7656b152781b14b6dbff1dfc3ae6868a74e 100644 (file)
@@ -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 ()
index 603fe089d6ae1b218b0903a3dd440a8bc95b7663..15dd2abf3a1ee50a11cb4167835011557154a835 100644 (file)
@@ -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 ();