From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14058 invoked by alias); 9 Dec 2011 20:20:17 -0000 Received: (qmail 14038 invoked by uid 22791); 9 Dec 2011 20:20:13 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Fri, 09 Dec 2011 20:20:01 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pB9KJd6X011433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 9 Dec 2011 15:19:39 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pB9KJciB008770; Fri, 9 Dec 2011 15:19:39 -0500 Received: from barimba (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 pB9KJbZu019494; Fri, 9 Dec 2011 15:19:37 -0500 From: Tom Tromey To: Jan Kratochvil Cc: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: Regression for gdb.base/sigstep.exp with .debug_types References: <20111205081911.GG28486@adacore.com> <20111209171630.GA30059@host2.jankratochvil.net> <20111209171937.GA30594@host2.jankratochvil.net> Date: Fri, 09 Dec 2011 20:50:00 -0000 In-Reply-To: <20111209171937.GA30594@host2.jankratochvil.net> (Jan Kratochvil's message of "Fri, 9 Dec 2011 18:19:37 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) 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: 2011-12/txt/msg00312.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> list static-method.cc:xxx::(anonymous namespace)::A::func Jan> -26 static int func (void) { return 0; } // xxx::A::func Jan> -(gdb) PASS: gdb.cp/static-method.exp: list Jan> static-method.cc:xxx::(anonymous namespace)::A::func Jan> +Function "xxx::(anonymous namespace)::A::func" not defined in Jan> "static-method.cc". Jan> +(gdb) FAIL: gdb.cp/static-method.exp: list Jan> static-method.cc:xxx::(anonymous namespace)::A::func I am not completely sure this is a bug. In this case, g++ puts the class "A" into a .debug_types TU. There is no link from the .debug_info CU to this TU -- the first thing I don't understand, I would have expected something. Second, the CU looks like this: <2><38>: Abbrev Number: 10 (DW_TAG_namespace) <39> DW_AT_sibling : <0x49> [...] <1><51>: Abbrev Number: 13 (DW_TAG_class_type) <52> DW_AT_name : A <54> DW_AT_declaration : 1 <54> DW_AT_sibling : <0x65> <2><58>: Abbrev Number: 6 (DW_TAG_subprogram) <59> DW_AT_name : (indirect string, offset: 0x0): func <5d> DW_AT_decl_file : 1 <5e> DW_AT_decl_line : 26 <5f> DW_AT_type : <0x65> <63> DW_AT_accessibility: 1 (public) <64> DW_AT_declaration : 1 Here, "A" is a declaration without a size, so it is ignored by process_structure_scope. Now consider the linespec: static-method.cc:xxx::(anonymous namespace)::A::func This means to find definitions of "xxx::(anonymous namespace)::A::func" defined in static-method.cc. There are two definitions of this function in the debuginfo. One is in the CU, but it is ignored when reading debuginfo because class A is dropped. One is in the TU, but it is ignored because TUs do not have line headers, and so the symtab is anonymous -- and so doesn't match "static-method.cc". So, what to do? Perhaps g++ is wrong not to emit some CU->TU linkage. If this existed then maybe we could make a symbol in the CU pointing to the type, presumably making this test work. Perhaps the DW_AT_declaration treatment in process_structure_scope is a bug -- but I would be cautious about changing this before a release. Let me know what you think. Tom