Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Keith Seitz <kseitz@uglyboxes.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 2/4] dwarf2_physname
Date: Tue, 24 Nov 2009 22:11:00 -0000	[thread overview]
Message-ID: <20091124221136.GC26004@adacore.com> (raw)
In-Reply-To: <4B0707E7.5010308@uglyboxes.com>

>         (read_partial_die): Ignore DW_AT_MIPS_linkage_name for all
>         languages except Ada.

More info on this. After asking the compiler guys, it turns out that
GCC generates DIEs with a DW_AT_MIPS_linkage_name attribute when
an entity has a different linkage name from the mangled name (this
happens when a pragma Export is used to force the linkage name of
an entity). For instance:

    package P is
    
       Myconst : Integer := 1234;
       pragma Export (C, Myconst, "hello");
    
    end P;

The compiler generates:

        .uleb128 0x2    # (DIE (0x25) DW_TAG_variable)
        .long   .LASF3  # DW_AT_name: "p__myconst"
        .byte   0x1     # DW_AT_decl_file (p.ads)
        .byte   0x3     # DW_AT_decl_line
        .long   .LASF4  # DW_AT_MIPS_linkage_name: "hello"

Now that I have been reminded of this, I now remember that we have
an open enhancement request to be able to use either the natural
name or the linkage name in order to specify our entity.  In other
words, users want to be able to do either of:

        (gdb) print p.myconst
        (gdb) print hello

Right now, we only allow the latter.  Honestly, I strongly suspect
that this is accidental due to use prefering the DW_AT_MIPS_linkage_name
attribute over the DW_AT_name, but ``I wasn't there''.

Going back to the enhancement request, the way we were hoping to be
able to deal with that was to take advantage of the two names being
provided for our DIE, so we can't really think of removing the handling
of this attribute entirely without thinking about a different approach
first. The approach taken here of conditionalizing this to the CU language
against Ada is fine as far as I am concerned - I'll concede that it's
a little ugly.

In terms of how I'm planning to implement the enhancement, I actually
haven't thought much about it. If Ada was able to store both natural
and linkage name at the same time (instead of computing the natural
name on-demand), it'd probably be working to just compute the natural
name based on the DW_AT_name attribute while using the DW_AT_MIPS_linkage_name
for the linkage name...

I would like Ada to do the same as other projects, but it's not necessarily
straightforward. In order to spend the memory to store the natural name,
I need to save some memory elsewhere (some of our customers have projects
that cause GDB to use up as much memory as allowed by the system!).
Tom's work might allow us that saving, but I need to find the time to
investigate this first, although one of these customers is on a stabs
platform, so it might not help us there...

To be continued...

-- 
Joel


      parent reply	other threads:[~2009-11-24 22:11 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 21:20 Keith Seitz
2009-11-20 22:10 ` Daniel Jacobowitz
2009-11-21  0:04   ` Tom Tromey
2009-11-21  3:46     ` Frank Ch. Eigler
2009-11-23 18:06       ` Tom Tromey
2009-11-23 19:00         ` Daniel Jacobowitz
2009-11-23 16:52   ` Keith Seitz
2009-11-23 17:08     ` Daniel Jacobowitz
2009-11-24 19:20       ` Sami Wagiaalla
2010-01-27 17:10         ` Sami Wagiaalla
2009-12-08 19:47   ` Keith Seitz
2009-12-14 19:33     ` Keith Seitz
2009-12-17 20:19       ` Tom Tromey
2009-12-17 20:28         ` Daniel Jacobowitz
2009-12-17 22:39           ` Paul Pluzhnikov
2009-12-22 18:35           ` Tom Tromey
2009-12-22 19:24             ` Daniel Jacobowitz
2010-01-20 20:37               ` Keith Seitz
2010-01-26 21:17                 ` Daniel Jacobowitz
2010-01-27 19:12                   ` Keith Seitz
2010-01-28 20:22                     ` Keith Seitz
2010-01-28 20:24                       ` Daniel Jacobowitz
2010-01-28 23:41                         ` Keith Seitz
2010-02-01 16:48                           ` Daniel Jacobowitz
2010-02-01 19:32                             ` Keith Seitz
2010-02-01 19:39                               ` Daniel Jacobowitz
2010-02-01 21:52                                 ` Keith Seitz
2010-02-01 22:19                                   ` Daniel Jacobowitz
2010-02-02 23:23                                     ` Keith Seitz
2010-02-02 23:31                                       ` Keith Seitz
2010-02-03  2:46                                       ` Daniel Jacobowitz
2010-02-04 17:48                                         ` Tom Tromey
2010-02-04 18:14                                           ` Daniel Jacobowitz
2010-02-05 17:13                                             ` Keith Seitz
2010-02-05 17:29                                               ` Daniel Jacobowitz
2010-02-05 20:24                                                 ` Keith Seitz
2010-02-05 20:57                                                   ` Daniel Jacobowitz
2010-02-05 23:10                                                     ` Keith Seitz
2010-02-05 23:46                                                       ` Daniel Jacobowitz
2010-02-04 17:21                             ` Tom Tromey
2010-02-04 17:25                               ` Daniel Jacobowitz
2009-11-23  7:31 ` André Pönitz
2009-11-23 16:57   ` Keith Seitz
2009-11-23 17:20     ` Tom Tromey
2009-11-24  7:22     ` André Pönitz
2009-11-24 22:54       ` Tom Tromey
2009-11-25  9:16         ` André Pönitz
2009-11-25 18:14           ` Tom Tromey
2009-11-23 17:15   ` Tom Tromey
2009-11-24 22:11 ` Joel Brobecker [this message]

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=20091124221136.GC26004@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kseitz@uglyboxes.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