From: Tom Tromey Date: Wed, 15 Apr 2026 17:35:32 +0000 (-0600) Subject: Remove some dead code from buildsym.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1007ed9405affd3b8ec20e421b732562612a5047;p=thirdparty%2Fbinutils-gdb.git 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 --- 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. */