Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [pushed] [gdb/symtab] Revert "Add assert in free_cached_comp_units constructor"
@ 2026-05-30 12:50 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2026-05-30 12:50 UTC (permalink / raw)
  To: gdb-patches

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 | 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 @@ class free_cached_comp_units
   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 ();

base-commit: 44df4c640694765fc028bdb0c64d346638466eab
-- 
2.51.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-30 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-30 12:50 [pushed] [gdb/symtab] Revert "Add assert in free_cached_comp_units constructor" Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox