This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Fix BZ 25065 - Ensure that physnames are computed for inherited DIEs


Hi Kevin,

I don't really have the big picture of these advanced DWARF use cases, so I can't really weigh on this, but I have a question:

diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index ee9df34ed2..f7ef122933 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -13666,6 +13666,17 @@ inherit_abstract_dies (struct die_info *die,
struct dwarf2_cu *cu)
       origin_child_die = sibling_die (origin_child_die);
     }
   origin_cu->list_in_scope = origin_previous_list_in_scope;
+
+  if (cu != origin_cu && !origin_cu->method_list.empty ())
+    {
+ /* Add list of methods found in origin_cu to the list in cu. These
+         methods still need to have their physnames computed in
+	 compute_delayed_physnames().  */
+      cu->method_list.insert (cu->method_list.end (),
+                              origin_cu->method_list.begin (),
+			      origin_cu->method_list.end ());
+      origin_cu->method_list.clear ();
+    }

So, this effectively makes the inheriting CU steal the method_list content from the inherited from CU? Is it possible for a CU to be inherited from multiple times? If so, what happens the second time we process something that inherits from this CU, the method_list vector will then be empty? Is it that we want?

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]