Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Michael Elizabeth Chastain <mec.gnu@mindspring.com>,
	 gdb@sources.redhat.com
Subject: Re: gcc HEAD dwarf-2, synthetic methods no longer public, gdb confused
Date: Sun, 04 Jul 2004 19:42:00 -0000	[thread overview]
Message-ID: <40E85DA4.20807@codesourcery.com> (raw)
In-Reply-To: <20040704145218.GA2095@nevyn.them.org>

[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]

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><f6b>: Abbrev Number: 21 (DW_TAG_subprogram)
>>     DW_AT_sibling     : <f98>
>>     DW_AT_external    : 1
>>     DW_AT_name        : (indirect string, offset: 0x9a3): operator=
>>     DW_AT_MIPS_linkage_name: _ZN5AlphaaSERKS_
>>     DW_AT_type        : <fd1>
>>     DW_AT_artificial  : 1
>>     DW_AT_declaration : 1
>>
>>With the new gcc HEAD, the dwarf-2 info looks like this:
>>
>> <2><f6b>: Abbrev Number: 21 (DW_TAG_subprogram)
>>     DW_AT_sibling     : <f86>
>>     DW_AT_name        : (indirect string, offset: 0x999): operator=
>>     DW_AT_type        : <fbd>
>>     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


[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 924 bytes --]

2004-07-04  Mark Mitchell  <mark@codesourcery.com>

	* 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;

  parent reply	other threads:[~2004-07-04 19:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-04 11:19 Michael Elizabeth Chastain
2004-07-04 14:52 ` Daniel Jacobowitz
2004-07-04 19:03   ` Mark Mitchell
2004-07-04 19:42   ` Mark Mitchell [this message]
2004-07-04 19:01 Michael Elizabeth Chastain
2004-07-05 23:45 Michael Elizabeth Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40E85DA4.20807@codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=mec.gnu@mindspring.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox