From: Tom Tromey Date: Wed, 15 Apr 2026 17:39:36 +0000 (-0600) Subject: Remove context_stack::depth X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f00b143cc80ba47e513c6a4b8acaed08a2a779b6;p=thirdparty%2Fbinutils-gdb.git Remove context_stack::depth context_stack::depth is never used, and I think it's not really useful, so this removes it. Approved-By: Simon Marchi --- diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 4156cd72100..0746717b014 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -924,17 +924,16 @@ buildsym_compunit::augment_type_symtab () } } -/* Push a context block. Args are an identifying nesting level - (checkable when you pop it), and the starting PC address of this +/* Push a context block. VALU is the starting PC address of this context. */ context_stack & -buildsym_compunit::push_context (int desc, CORE_ADDR valu) +buildsym_compunit::push_context (CORE_ADDR valu) { context_stack &ctx = m_context_stack.emplace_back (std::move (m_local_symbols), m_local_using_directives, - m_pending_blocks, valu, desc); + m_pending_blocks, valu); m_local_using_directives = nullptr; diff --git a/gdb/buildsym.h b/gdb/buildsym.h index 06d8d3c691f..70d22229f53 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -74,12 +74,11 @@ using subfile_up = std::unique_ptr; struct context_stack { context_stack (std::vector locals, using_direct *local_using_directives, - pending_block *old_blocks, CORE_ADDR start_addr, int depth) + pending_block *old_blocks, CORE_ADDR start_addr) : locals (std::move (locals)), local_using_directives (local_using_directives), old_blocks (old_blocks), - start_addr (start_addr), - depth (depth) + start_addr (start_addr) {} /* Outer locals at the time we entered. */ @@ -96,9 +95,6 @@ struct context_stack /* PC where this context starts. */ CORE_ADDR start_addr; - - /* For error-checking matching push/pop. */ - int depth; }; /* Flags associated with a linetable entry. */ @@ -245,7 +241,7 @@ struct buildsym_compunit m_producer = producer; } - context_stack &push_context (int desc, CORE_ADDR valu); + context_stack &push_context (CORE_ADDR valu); context_stack pop_context (); diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index beb1a440f1b..c4601fee391 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7803,7 +7803,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu) } gdb_assert (cu->get_builder () != nullptr); - context_stack &ctx = cu->get_builder ()->push_context (0, lowpc); + context_stack &ctx = cu->get_builder ()->push_context (lowpc); ctx.name = new_symbol (die, read_type_die (die, cu), cu, templ_func); if (dwarf2_func_is_main_p (die, cu)) @@ -7955,7 +7955,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu) lowpc = per_objfile->relocate (unrel_low); highpc = per_objfile->relocate (unrel_high); - cu->get_builder ()->push_context (0, lowpc); + cu->get_builder ()->push_context (lowpc); for (die_info *child_die : die->children ()) process_die (child_die, cu);