public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: fix PR 11961
@ 2010-08-31 20:00 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2010-08-31 20:00 UTC (permalink / raw)
  To: gdb-patches

I am checking this in.

This fixes PR 11961.  The bug is that when reading a
DW_TAG_template_type_param, we might set the TYPE_NAME of the type.
We never want to do this, because in this case the name is the template
parameter's name, not anything related to the type.

Built and regtested on x86-64 (compile farm).

Tom

2010-08-31  Tom Tromey  <tromey@redhat.com>

	PR c++/11961:
	* dwarf2read.c (new_symbol_full) <DW_TAG_template_type_param>:
	Don't set TYPE_NAME on the type.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.448
diff -u -r1.448 dwarf2read.c
--- dwarf2read.c	27 Aug 2010 23:09:58 -0000	1.448
+++ dwarf2read.c	31 Aug 2010 19:59:44 -0000
@@ -10729,20 +10729,21 @@
 			       && (cu->language == language_cplus
 				   || cu->language == language_java)
 			       ? &global_symbols : cu->list_in_scope);
-	      }
 
-	    /* The semantics of C++ state that "struct foo { ... }" also
-	       defines a typedef for "foo".  A Java class declaration also
-	       defines a typedef for the class.  */
-	    if (cu->language == language_cplus
-		|| cu->language == language_java
-		|| cu->language == language_ada)
-	      {
-		/* The symbol's name is already allocated along with
-		   this objfile, so we don't need to duplicate it for
-		   the type.  */
-		if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
-		  TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_SEARCH_NAME (sym);
+		/* The semantics of C++ state that "struct foo {
+		   ... }" also defines a typedef for "foo".  A Java
+		   class declaration also defines a typedef for the
+		   class.  */
+		if (cu->language == language_cplus
+		    || cu->language == language_java
+		    || cu->language == language_ada)
+		  {
+		    /* The symbol's name is already allocated along
+		       with this objfile, so we don't need to
+		       duplicate it for the type.  */
+		    if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
+		      TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_SEARCH_NAME (sym);
+		  }
 	      }
 	  }
 	  break;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-31 20:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-31 20:00 FYI: fix PR 11961 Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).