This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix namespace aliases (c++/7539, c++/10541)
- From: Tom Tromey <tromey at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches\ at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Wed, 31 Jul 2013 12:46:28 -0600
- Subject: Re: [RFA] Fix namespace aliases (c++/7539, c++/10541)
- References: <51F2CAB9 dot 2030604 at redhat dot com> <877gg9nm9x dot fsf at fleche dot redhat dot com> <51F841CF dot 9030301 at redhat dot com>
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Tom> Or, if the program is stopped in a function inside a namespace, can the
Tom> user use the "local" (not fully qualified) alias?
Keith> This particular feature is c++/13884. That is an entirely different
Keith> problem. I've updated the bug with some comments explaining what's
Keith> going on.
Ok, thanks.
Tom> I don't think either of these situations is tested.
Keith> I've added tests for the recursive alias. If/when I get around to
Keith> fixing 13384, I'll add tests for that.
Sounds good.
I was also curious why the new type is a TYPE_CODE_NAMESPACE and not a
TYPE_CODE_TYPEDEF. Maybe that is too goofy though.
Keith> + /* If the compiler has nested DW_AT_imported_declaration DIEs,
Keith> + keep inspecting DIEs until we hit the underlying import. */
Keith> + while (1)
Keith> + {
Keith> + attr = dwarf2_attr (d, DW_AT_import, cu);
Keith> + if (attr == NULL)
Keith> + break;
Keith> +
Keith> + d = follow_die_ref (d, attr, &imported_cu);
Keith> + if (d->tag != DW_TAG_imported_declaration)
Keith> + break;
Keith> + }
Now I'm concerned that bad DWARF can send gdb into an infinite loop
here.
Sorry about that. If compilers don't emit chained imports like this,
then it is fine to just go back to the old code.
Otherwise I guess we'd need the tortoise-and-hare thing here.
Tom