This is the mail archive of the gdb-patches@sources.redhat.com 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]

[intercu] Union fix for C++


It turns out that unions can have methods.  I never knew that before; thank
you, monotone.

I also changed the check from C++ to not-C; Java presumably has the same
issues with aggregates.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-21  Daniel Jacobowitz  <drow@mvista.com>

	* dwarf2read.c (load_partial_dies): Follow unions.  Follow
	aggregates for all non-C languages.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.135.2.8
diff -u -p -r1.135.2.8 dwarf2read.c
--- dwarf2read.c	21 Feb 2004 21:00:12 -0000	1.135.2.8
+++ dwarf2read.c	21 Feb 2004 21:07:33 -0000
@@ -4599,16 +4599,17 @@ load_partial_dies (bfd *abfd, char *info
       part_die = obstack_alloc (&cu->partial_die_obstack,
 				sizeof (struct partial_die_info));
 
-      /* For some DIEs we want to follow their children (if any).  We do
-         not normally follow the children of structures; do so for C++
-         so that we can use method physnames to infer fully qualified
-         type names.  */
+      /* For some DIEs we want to follow their children (if any).  For C
+         we have no reason to follow the children of structures; for other
+	 languages we have to, both so that we can get at method physnames
+	 to infer fully qualified class names, and for DW_AT_specification.  */
       if (last_die->has_children
 	  && (last_die->tag == DW_TAG_namespace
 	      || last_die->tag == DW_TAG_enumeration_type
-	      || (cu->language == language_cplus
+	      || (cu->language != language_c
 		  && (last_die->tag == DW_TAG_class_type
-		      || last_die->tag == DW_TAG_structure_type))))
+		      || last_die->tag == DW_TAG_structure_type
+		      || last_die->tag == DW_TAG_union_type))))
 	{
 	  nesting_level++;
 	  parent_die = last_die;


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