[binutils-gdb] Remove some dead code from buildsym.c

Tom Tromey via Gdb-cvs <[email protected]>
Newsgroups gmane.comp.gdb.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1007ed9405affd3b8ec20e421b732562612a5047

commit 1007ed9405affd3b8ec20e421b732562612a5047
Author: Tom Tromey <[email protected]>
Date:   Wed Apr 15 11:35:32 2026 -0600

    Remove some dead code from buildsym.c
    
    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 <[email protected]>

Diff:
---
 gdb/buildsym.c | 25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index aa95889424b..4156cd72100 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -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.  */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.