From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4954 invoked by alias); 18 Jun 2012 20:22:30 -0000 Received: (qmail 4936 invoked by uid 22791); 18 Jun 2012 20:22:26 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,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; Mon, 18 Jun 2012 20:22:13 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5IKMC3l028413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 18 Jun 2012 16:22:12 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5IKMBrH023319 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 18 Jun 2012 16:22:12 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: FYI: fix spelling of "delete" in c-exp.y Date: Mon, 18 Jun 2012 20:22:00 -0000 Message-ID: <87k3z4pdzg.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain 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: 2012-06/txt/msg00598.txt.bz2 I'm checking this in. Running the test suite with a modified compiler (jason/comdat-debug in gcc git) shows a few regressions. Debugging one of these showed that there were some extra spaces in c-exp.y, that caused problems in this test case. This patch removes the spaces. psymtab_search_name will not remove a trailing space; but it will remove a trailing " ()". That is the core of the problem. That plus the fact that, with an unmodified compiler, all the methods end up in the same CU, so we bypass the psymtab bits for the particular lookup. I was also surprised to find the call to value_maybe_namespace_elt in from value_struct_elt_for_reference doing a lot of work here. I suspect this is basically a consequence of not doing type interning; we end up with different copies of the enclosing type in different CUs, and each one has a different set of methods attached depending on which CU contains a method's body. IOW, symbol tables are a crazy mess, see http://sourceware.org/gdb/wiki/SymbolHandling Built and regtested on x86-64 Fedora 16, with the comdat-debug gcc and the system gcc. Tom 2012-06-18 Tom Tromey * c-exp.y (operator): Remove trailing space after "delete" and "delete[]". diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 1e14337..bf53fbc 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1224,11 +1224,11 @@ const_or_volatile_noopt: const_and_volatile operator: OPERATOR NEW { $$ = operator_stoken (" new"); } | OPERATOR DELETE - { $$ = operator_stoken (" delete "); } + { $$ = operator_stoken (" delete"); } | OPERATOR NEW '[' ']' { $$ = operator_stoken (" new[]"); } | OPERATOR DELETE '[' ']' - { $$ = operator_stoken (" delete[] "); } + { $$ = operator_stoken (" delete[]"); } | OPERATOR '+' { $$ = operator_stoken ("+"); } | OPERATOR '-'