Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/symtab] Revert "Add assert in free_cached_comp_units constructor"
Date: Sat, 30 May 2026 14:50:28 +0200	[thread overview]
Message-ID: <20260530125028.1823106-1-tdevries@suse.de> (raw)

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


                 reply	other threads:[~2026-05-30 12:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260530125028.1823106-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox