This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Fix some cases of "using" declarations with older G++ versions
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 25 Mar 2010 19:13:07 +0100
- Subject: Re: [rfc] Fix some cases of "using" declarations with older G++ versions
- References: <201003251627.o2PGR0Mm002491@d12av02.megacenter.de.ibm.com>
On Thu, 25 Mar 2010 17:27:00 +0100, Ulrich Weigand wrote:
> @@ -3940,6 +3940,30 @@ read_func_scope (struct die_info *die, s
>
> inherit_abstract_dies (die, cu);
>
> + /* If we have a DW_AT_specification, we might need to import using
> + directives from the context of the specification DIE. See the
> + comment in determine_prefix. */
> + if (cu->language == language_cplus)
> + {
> + struct dwarf2_cu *spec_cu = cu;
> + struct die_info *spec_die = die_specification (die, &spec_cu);
This may also fetch DW_AT_abstract_origin which has been already imported by
inherit_abstract_dies. But duplicate DW_TAG_imported_module should not hurt.
> +
> + while (spec_die)
> + {
> + child_die = spec_die->child;
> + while (child_die && child_die->tag)
> + {
> + if (child_die->tag == DW_TAG_imported_module)
> + process_die (child_die, cu);
spec_cu probably?
> + child_die = sibling_die (child_die);
> + }
> +
> + /* In some cases, GCC generates specification DIEs that
> + themselves contain DW_AT_specification attributes. */
> + spec_die = die_specification (spec_die, &spec_cu);
> + }
> + }
> +
> new = pop_context ();
> /* Make a block for the local symbols within. */
> block = finish_block (new->name, &local_symbols, new->old_blocks,
Thanks,
Jan