From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10010 invoked by alias); 4 Jul 2004 19:42:34 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 10002 invoked from network); 4 Jul 2004 19:42:33 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.5) by sourceware.org with SMTP; 4 Jul 2004 19:42:33 -0000 Received: (qmail 17476 invoked from network); 4 Jul 2004 19:42:32 -0000 Received: from localhost (HELO codesourcery.com) (mitchell@127.0.0.1) by mail.codesourcery.com with SMTP; 4 Jul 2004 19:42:32 -0000 Message-ID: <40E85DA4.20807@codesourcery.com> Date: Sun, 04 Jul 2004 19:42:00 -0000 From: Mark Mitchell Organization: CodeSourcery, LLC User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 MIME-Version: 1.0 To: Daniel Jacobowitz CC: Michael Elizabeth Chastain , gdb@sources.redhat.com Subject: Re: gcc HEAD dwarf-2, synthetic methods no longer public, gdb confused References: <20040704111919.73AEA4B104@berman.michael-chastain.com> <20040704145218.GA2095@nevyn.them.org> In-Reply-To: <20040704145218.GA2095@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------010504040205040508000202" X-SW-Source: 2004-07/txt/msg00028.txt.bz2 This is a multi-part message in MIME format. --------------010504040205040508000202 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1562 Daniel Jacobowitz wrote: >On Sun, Jul 04, 2004 at 07:19:19AM -0400, Michael Chastain wrote: > > >>Here's my next problem with gcc HEAD -gdwarf-2. I suspect this is a bug >>in gdb rather than gcc. >> >>I've got a test program with a class, Alpha, that has a >>compiler-synthesized assignment operator. That is, Alpha does not >>declare or define an operator=, so the C++ compiler has to generate >>one itself. >> >>With the old gcc HEAD, the dwarf-2 info looks like this: >> >> <2>: Abbrev Number: 21 (DW_TAG_subprogram) >> DW_AT_sibling : >> DW_AT_external : 1 >> DW_AT_name : (indirect string, offset: 0x9a3): operator= >> DW_AT_MIPS_linkage_name: _ZN5AlphaaSERKS_ >> DW_AT_type : >> DW_AT_artificial : 1 >> DW_AT_declaration : 1 >> >>With the new gcc HEAD, the dwarf-2 info looks like this: >> >> <2>: Abbrev Number: 21 (DW_TAG_subprogram) >> DW_AT_sibling : >> DW_AT_name : (indirect string, offset: 0x999): operator= >> DW_AT_type : >> DW_AT_artificial : 1 >> DW_AT_declaration : 1 >> >>The difference is that DW_AT_external and DW_AT_MIPS_linkage_name >>have gone away. >> >> > >Is the method code emitted beforehand? How about afterwards? I'm >assuming that it is emitted in both cases. Is it marked .globl before >and after? > This patch should restore the behavior before my patch. Tested on x86_64-unknown-linux-gnu, applied on the mainline. -- Mark Mitchell CodeSourcery, LLC (916) 791-8304 mark@codesourcery.com --------------010504040205040508000202 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 924 2004-07-04 Mark Mitchell * method.c (implicitly_declare_fn): Set linkage of generated functions. Index: method.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/cp/method.c,v retrieving revision 1.292 diff -c -5 -p -r1.292 method.c *** method.c 2 Jul 2004 01:15:42 -0000 1.292 --- method.c 4 Jul 2004 19:40:40 -0000 *************** implicitly_declare_fn (special_function_ *** 1016,1025 **** --- 1016,1026 ---- } grokclassfn (type, fn, kind == sfk_destructor ? DTOR_FLAG : NO_SPECIAL, TYPE_UNQUALIFIED); grok_special_member_properties (fn); + TREE_PUBLIC (fn) = !decl_function_context (TYPE_MAIN_DECL (type)); cp_finish_decl (fn, /*init=*/NULL_TREE, /*asmspec_tree=*/NULL_TREE, /*flags=*/LOOKUP_ONLYCONVERTING); DECL_IN_AGGR_P (fn) = 1; DECL_ARTIFICIAL (fn) = 1; DECL_NOT_REALLY_EXTERN (fn) = 1; --------------010504040205040508000202--