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: gdb-patches@sourceware.org
Subject: Re: [RFA 2/4] dwarf2_physname
Date: Thu, 04 Feb 2010 17:48:00 -0000	[thread overview]
Message-ID: <m3pr4kki3m.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20100203024553.GA22235@caradoc.them.org> (Daniel Jacobowitz's 	message of "Tue, 2 Feb 2010 21:45:55 -0500")

>>>>> "Daniel" == Daniel Jacobowitz <dan@codesourcery.com> writes:

Daniel> I don't doubt that what you've got is correctly identifying and
Daniel> handling GCC's output.  But it does so by pattern matching on what GCC
Daniel> currently emits, not by using tests that are sound according to the
Daniel> standard.  So with some future GCC, or some other non-GCC compiler,
Daniel> it will probably fall down.

Daniel> I don't believe that most of GCC's uses of DW_AT_specification are
Daniel> required by the standard.  And I don't think they're the only valid
Daniel> uses of DW_AT_specification.  So keying off whether that attribute is
Daniel> present is too 'fuzzy' for me.

I want to tie this back to the original code to see if I understand what
part you are concerned about.

>> +    case DW_TAG_variable:
>> +      {
>> +	struct attribute *attr;
>> +	attr = dwarf2_attr (die, DW_AT_specification, cu);
>> +	if (attr)
>> +	  return 1;

Based on the above I am guessing it is the early return here?

That is the only thing I could think of, because AFAICT this code
generally respects what DWARF says.  My understanding is that there are
2 cases.

1. If the variable is declared in the namespace scope, but defined
outside, then a second defining DIE is emitted that refers to the
declaration DIE using DW_AT_specification.  In this case the declaration
DIE's namespace is used.

... The code above seems to cheat a tiny bit because it unconditionally
returns 1 in this case, whereas it should perhaps recurse.

2. If the variable is defined in the namespace scope, then no
DW_AT_specification exists, and we use the DIE's parentage.  The code
gets this right.

Daniel> I'm asking for you to either convince me that my assumptions in the
Daniel> previous paragraph are incorrect, or to find some way that the
Daniel> standard will support to answer the same query about the properties of
Daniel> the DW_TAG_variable DIE.  For instance, should we find the DIE's
Daniel> logical location the same way determine_prefix does (parent, or
Daniel> specification's parent) and then draw some conclusion based on
Daniel> the type of the logical parent?

From what I can tell, die_needs_namespace is consistent with
determine_prefix, with the caveat that it is is an approximation, due to
the lack of recursion.  It is more like "die_may_need_namespace".

I'm still not understanding what problem you see, but I would like to.

Tom


  reply	other threads:[~2010-02-04 17:48 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 [this message]
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

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