]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove context_stack::depth
authorTom Tromey <tromey@adacore.com>
Wed, 15 Apr 2026 17:39:36 +0000 (11:39 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 20 Apr 2026 14:23:16 +0000 (08:23 -0600)
context_stack::depth is never used, and I think it's not really
useful, so this removes it.

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

index 4156cd7210010c6af53c96bf1e088f7953250c9d..0746717b014aaec09d88cc682b5a7dce2c9186b1 100644 (file)
@@ -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;
 
index 06d8d3c691ffd576f44926b88b3d1ac41a55cae2..70d22229f5347fc210fbeeab5ed34c810e3ebc5f 100644 (file)
@@ -74,12 +74,11 @@ using subfile_up = std::unique_ptr<subfile>;
 struct context_stack
 {
   context_stack (std::vector<symbol *> 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 ();
 
index beb1a440f1b3b9adab5cca40789c22741e262b8c..c4601fee3917f64ca673df7feaaf1b6456592e5d 100644 (file)
@@ -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);