This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/4] dwarf2_physname
- From: Daniel Jacobowitz <dan at codesourcery dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 1 Feb 2010 14:39:45 -0500
- Subject: Re: [RFA 2/4] dwarf2_physname
- References: <m3eimm7t7g.fsf@fleche.redhat.com> <20091222192444.GB15339@caradoc.them.org> <4B576983.2090808@redhat.com> <20100126211733.GA17877@caradoc.them.org> <4B609019.1090807@redhat.com> <4B61F20B.7070908@redhat.com> <20100128202429.GA29835@caradoc.them.org> <4B622047.7020503@redhat.com> <20100201164837.GF21339@caradoc.them.org> <4B672C38.60007@redhat.com>
On Mon, Feb 01, 2010 at 11:32:08AM -0800, Keith Seitz wrote:
> On 02/01/2010 08:48 AM, Daniel Jacobowitz wrote:
> >>+ case DW_TAG_variable:
> >>+ {
> >>+ struct attribute *attr;
> >>+ attr = dwarf2_attr (die, DW_AT_specification, cu);
> >>+ if (attr)
> >>+ return 1;
> >>+ attr = dwarf2_attr (die, DW_AT_external, cu);
> >>+ if (attr == NULL&& die->parent->tag != DW_TAG_namespace)
> >>+ return 0;
> >>+ return 1;
> >>+ }
> >>+ break;
> >>+
> >> default:
> >> return 0;
> >> }
> >
> >What's this about? It needs an explanation, and I don't think
> >DW_AT_specification has anything to do with die_needs_namespace.
>
> DW_AT_specification is, as I deduce from ifdefing that out and
> running the testsuite :-), needed for many namespace-based variables:
DW_AT_specification is present for many variables in namespaces
(at least in current GCC output). But what significance does it
actually have? Can you explain the check above in terms of the DWARF
standard? If not, I don't think it's right.
DW_AT_specification just says that there is a specification of this
variable in another DIE. The same variable could be written with
or without it.
--
Daniel Jacobowitz
CodeSourcery