Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb-patches@sourceware.org
Subject: Re: The future of dwarf2_physname
Date: Fri, 20 May 2011 20:39:00 -0000	[thread overview]
Message-ID: <m3fwo95cpw.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4DD6C6B4.7060406@redhat.com> (Keith Seitz's message of "Fri, 20	May 2011 12:53:24 -0700")

Keith> I wouldn't say that DW_AT_MIPS_linkage_name is any more ISO C++
Keith> compliant than anything else. Just because the compiler outputs it
Keith> does not necessarily make it sacrosanct. [gcc/33861]

I think that bug shows the opposite, actually.  If you look at the
DWARF:

 <1><25>: Abbrev Number: 2 (DW_TAG_structure_type)
    <26>   DW_AT_name        : (indirect string, offset: 0x77): Qux<((char*)(& name))>  

That is, the bug here is that G++ emits a bad and weird DW_AT_name.

But, if you look at the member function:

 <2><31>: Abbrev Number: 3 (DW_TAG_subprogram)
    <32>   DW_AT_external    : 1        
    <33>   DW_AT_name        : foo      
    <37>   DW_AT_decl_file   : 1        
    <38>   DW_AT_decl_line   : 7        
    <39>   DW_AT_MIPS_linkage_name: (indirect string, offset: 0x5a): _ZN3QuxIXadL_Z4nameEEE3fooEv       

.. run through c++filt:

    <39>   DW_AT_MIPS_linkage_name: (indirect string, offset: 0x5a): Qux<&name>::foo()  

Here, the linkage name and demangler are correct.

Also even if you strip down the class' DW_AT_name, you probably have
trouble reconstructing the template argument:

 <2><51>: Abbrev Number: 5 (DW_TAG_template_value_param)
    <52>   DW_AT_name        : V        
    <54>   DW_AT_type        : <0xaf>   
    <58>   DW_AT_location    : 6 byte block: 3 0 0 0 0 9f       (DW_OP_addr: 0; DW_OP_stack_value)

... since that is just the address of 'name', which IIUC may appear
elsewhere, perhaps without debuginfo.  I guess it ought to always appear
in minimal symbols in that case... maybe it isn't as bad as I thought.


I get this from my patch branch:

opsy. ../gdb -readnow -batch -ex 'set complaint 10000' -ex 'file /tmp/q.o'
During symbol reading...Computed physname <Qux<(char*)(&name)>::foo()> does not match demangled <Qux<&name>::foo()> (from linkage <_ZN3QuxIXadL_Z4nameEEE3fooEv>) - DIE at 0x31 [in module /tmp/q.o]...

Jan> That is the GCC and ISO C++ naming should be always available in
Jan> GDB.  I am not against allowing also other aliases for the same
Jan> symbol.  The availability of symbol aliases is discussed more at
Jan> the end of this mail.

Keith> I agree.

Great, we have a starting point :)

Jan> I do not see any real regressions except incorrect testcase assumptions.

Keith> Unless the assumption is that gdb can only set breakpoints on linkage
Keith> names, I don't call the test cases broken or illegal. If your argument
Keith> is that you don't like the way it was solved, that's an entirely
Keith> different assertion, and one with much more merit.

Yes, I actually agree with both of you, in the sense that I think both
sets of tests ought to pass.

Tom


  parent reply	other threads:[~2011-05-20 20:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 22:35 Keith Seitz
2011-05-19 19:23 ` Jan Kratochvil
2011-05-20 19:53   ` Keith Seitz
2011-05-20 20:38     ` Jan Kratochvil
2011-05-20 20:39     ` Tom Tromey [this message]
2011-05-21 20:37       ` Daniel Jacobowitz
2011-05-19 21:00 ` Daniel Jacobowitz
2011-05-20 19:26   ` Tom Tromey
2011-05-21 20:34     ` Daniel Jacobowitz
2011-05-20 19:10 ` Tom Tromey
2011-05-23 13:17 ` Jan Kratochvil
2011-05-23 19:52   ` Tom Tromey
2011-05-23 19:57     ` Keith Seitz
2011-05-24 21:12   ` [rfc 1/2] libiberty/ options code reshuffle [Re: The future of dwarf2_physname] Jan Kratochvil
2011-06-02 15:36     ` obsolete: " Jan Kratochvil
2011-05-24 21:21   ` [rfc 2/2] Follow DW_AT_linkage_name for methods " Jan Kratochvil
2011-05-25 19:40     ` Keith Seitz
2011-05-25 20:42       ` Tom Tromey
2011-05-25 20:40     ` Tom Tromey
2011-06-01 18:35       ` Keith Seitz
2011-06-02 16:26         ` Jan Kratochvil
2011-06-02 18:20           ` Tom Tromey
2011-06-02 18:28             ` Jan Kratochvil
2011-06-02 19:03     ` obsolete: " Jan Kratochvil

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=m3fwo95cpw.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=keiths@redhat.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