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 11:48:37 -0500
- 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>
I think we need to get these patches in to make progress; they're too
big, and getting them down to no regressions on one platform is
already a noteworthy accomplishment. So I'm going to keep comments to
a minimum.
That means you should probably wait to commit this until after GDB 7.1
branches (~ 2 weeks).
On Thu, Jan 28, 2010 at 03:39:51PM -0800, Keith Seitz wrote:
> -/* Determine whether a die of type TAG living in a C++ class or
> - namespace needs to have the name of the scope prepended to the
> - name listed in the die. */
> +/* Determine whether DIE needs to have the name of the scope prepended
> + to the name listed in the die. */
>
> static int
> -pdi_needs_namespace (enum dwarf_tag tag)
> +die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu)
> {
> - switch (tag)
> + switch (die->tag)
> {
> case DW_TAG_namespace:
> case DW_TAG_typedef:
> @@ -2623,7 +2612,23 @@ pdi_needs_namespace (enum dwarf_tag tag)
> case DW_TAG_union_type:
> case DW_TAG_enumeration_type:
> case DW_TAG_enumerator:
> + case DW_TAG_subprogram:
> + case DW_TAG_member:
> return 1;
> +
> + 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.
--
Daniel Jacobowitz
CodeSourcery