This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/4] dwarf2_physname
- From: Keith Seitz <keiths at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 01 Feb 2010 11:32:08 -0800
- Subject: Re: [RFA 2/4] dwarf2_physname
- References: <m38wd1gxp6.fsf@fleche.redhat.com> <20091217202843.GA11961@caradoc.them.org> <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>
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:
*************** PASS: gdb.cp/namespace.exp: ptype OtherF
*** 12145,12159 ****
KFAIL: gdb.cp/namespace.exp: ptype ::C::OtherFileClass (PRMS: gdb/1448)
PASS: gdb.cp/namespace.exp: ptype C::OtherFileClass
PASS: gdb.cp/namespace.exp: print cX
! PASS: gdb.cp/namespace.exp: print 'F::cXf'
! PASS: gdb.cp/namespace.exp: print F::cXf
! PASS: gdb.cp/namespace.exp: print F::cXfX
PASS: gdb.cp/namespace.exp: print X
! PASS: gdb.cp/namespace.exp: print 'G::Xg'
! PASS: gdb.cp/namespace.exp: print G::Xg
! PASS: gdb.cp/namespace.exp: print G::XgX
! PASS: gdb.cp/namespace.exp: print cXOtherFile
! PASS: gdb.cp/namespace.exp: print XOtherFile
PASS: gdb.cp/namespace.exp: print AAA::ALPHA
Running ../../../src/gdb/testsuite/gdb.cp/namespace-nested-import.exp ...
PASS: gdb.cp/namespace-nested-import.exp: print C::x
--- 12145,12159 ----
KFAIL: gdb.cp/namespace.exp: ptype ::C::OtherFileClass (PRMS: gdb/1448)
PASS: gdb.cp/namespace.exp: ptype C::OtherFileClass
PASS: gdb.cp/namespace.exp: print cX
! FAIL: gdb.cp/namespace.exp: print 'F::cXf'
! FAIL: gdb.cp/namespace.exp: print F::cXf
! FAIL: gdb.cp/namespace.exp: print F::cXfX
PASS: gdb.cp/namespace.exp: print X
! FAIL: gdb.cp/namespace.exp: print 'G::Xg'
! FAIL: gdb.cp/namespace.exp: print G::Xg
! FAIL: gdb.cp/namespace.exp: print G::XgX
! FAIL: gdb.cp/namespace.exp: print cXOtherFile
! FAIL: gdb.cp/namespace.exp: print XOtherFile
PASS: gdb.cp/namespace.exp: print AAA::ALPHA
Running ../../../src/gdb/testsuite/gdb.cp/namespace-nested-import.exp ...
PASS: gdb.cp/namespace-nested-import.exp: print C::x
I apologize, it has been quite some time since this was written, and
I've forgotten much of the context. So commenting out the code and
re-running the test suite is the best I can do to remember why some
things were done.
Was there something else in particular that was unclear?
Keith
PS. Tom also has a patch on expr-cumulative in this spot that deals with
static variables defined inside a block.