From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19613 invoked by alias); 31 Aug 2010 20:00:50 -0000 Received: (qmail 19605 invoked by uid 22791); 31 Aug 2010 20:00:49 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 Aug 2010 20:00:45 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7VK0hvF012704 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 31 Aug 2010 16:00:43 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7VK0gHk016756; Tue, 31 Aug 2010 16:00:43 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o7VK0gvN005157; Tue, 31 Aug 2010 16:00:42 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 20C4D3792BC; Tue, 31 Aug 2010 14:00:42 -0600 (MDT) From: Tom Tromey To: gdb-patches@sourceware.org Subject: FYI: fix PR 11961 Date: Tue, 31 Aug 2010 20:00:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00574.txt.bz2 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 PR c++/11961: * dwarf2read.c (new_symbol_full) : 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;