]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove context_stack::static_link
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 5 Jan 2026 20:38:18 +0000 (15:38 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 6 Jan 2026 16:29:05 +0000 (11:29 -0500)
I don't think it's needed to record this information in the
context_stack structure.  The only user is the DWARF reader, where it
can very well be a local variable.

Change-Id: I6e33affbf03f11c0d0ab60067f169137fde1c994
Approved-By: Tom Tromey <tom@tromey.com>
gdb/buildsym.h
gdb/dwarf2/read.c

index ff1c2a075fccfe6b5f25941440163f102b0c9b17..7ca5e57c7f4a0b841a7a34fe60b70249b3377e15 100644 (file)
@@ -94,10 +94,6 @@ struct context_stack
   /* Name of function, if any, defining context.  */
   symbol *name = nullptr;
 
-  /* Expression that computes the frame base of the lexically enclosing
-     function, if any.  NULL otherwise.  */
-  dynamic_prop *static_link = nullptr;
-
   /* PC where this context starts.  */
   CORE_ADDR start_addr;
 
index 4edd9cf2591c43b25df412a4d187f87d1b5b9c06..05a285728da464017ca81e138633f215e201b66e 100644 (file)
@@ -8586,14 +8586,12 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
     dwarf2_symbol_mark_computed (attr, ctx.name, cu, 1);
 
   /* If there is a location for the static link, record it.  */
-  ctx.static_link = NULL;
+  dynamic_prop *static_link = nullptr;
   attr = dwarf2_attr (die, DW_AT_static_link, cu);
   if (attr != nullptr)
     {
-      ctx.static_link
-       = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
-      attr_to_dynamic_prop (attr, die, cu, ctx.static_link,
-                           cu->addr_type ());
+      static_link = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
+      attr_to_dynamic_prop (attr, die, cu, static_link, cu->addr_type ());
     }
 
   cu->list_in_scope = &cu->get_builder ()->get_local_symbols ();
@@ -8636,9 +8634,10 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
     }
 
   struct context_stack cstk = cu->get_builder ()->pop_context ();
+
   /* Make a block for the local symbols within.  */
   block = cu->get_builder ()->finish_block (cstk.name, cstk.old_blocks,
-                                    cstk.static_link, lowpc, highpc);
+                                           static_link, lowpc, highpc);
 
   /* For C++, set the block's scope.  */
   if ((cu->lang () == language_cplus