Re: [RFA 2/4] dwarf2_physname

Daniel Jacobowitz
2010-02-01T16:48:47Z

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