This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Fix namespace aliases (c++/7539, c++/10541)


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]