]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove some dead code from buildsym.c
authorTom Tromey <tromey@adacore.com>
Wed, 15 Apr 2026 17:35:32 +0000 (11:35 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 20 Apr 2026 14:23:16 +0000 (08:23 -0600)
This patch removes some code from buildsym.c that, according to the
comment, was only used for some SCO or maybe COFF thing.  This code is
dead now, and it was a hack anyway and probably should never have been
allowed.

In v2 I've removed the entire block, since callers should be pairing
pushes and pops anyway.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/buildsym.c

index aa95889424bd2928fb1b0e14f50a3fda37d91a8e..4156cd7210010c6af53c96bf1e088f7953250c9d 100644 (file)
@@ -625,28 +625,9 @@ buildsym_compunit::end_compunit_symtab_get_static_block (CORE_ADDR end_addr,
                                                         bool expandable,
                                                         bool required)
 {
-  /* Finish the lexical context of the last function in the file; pop
-     the context stack.  */
-
-  if (!m_context_stack.empty ())
-    {
-      struct context_stack cstk = pop_context ();
-
-      /* Make a block for the local symbols within.  */
-      finish_block (cstk.name, cstk.old_blocks, NULL,
-                   cstk.start_addr, end_addr);
-
-      if (!m_context_stack.empty ())
-       {
-         /* This is said to happen with SCO.  The old coffread.c
-            code simply emptied the context stack, so we do the
-            same.  FIXME: Find out why it is happening.  This is not
-            believed to happen in most cases (even for coffread.c);
-            it used to be an abort().  */
-         complaint (_("Context stack not empty in end_compunit_symtab"));
-         m_context_stack.clear ();
-       }
-    }
+  /* The user should have guaranteed that all previous blocks have
+     been created.  */
+  gdb_assert (m_context_stack.empty ());
 
   /* Executables may have out of order pending blocks; sort the
      pending blocks.  */