https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80263

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
Possible solutions could be:

 #1 - emit the underlying type instead.
 #2 - emit no name.

#2 seems to be valid DWARF5, which says (page 103):

"A base type entry may have a DW_AT_name attribute whose value is a
null-terminated string containing the name of the base type as recognized by
the programming language of the compilation unit containing the base type
entry."

(Particularly, it says "may".)

GDB isn't fully prepared for that though.  In its read_base_type function, it
has:

  name = dwarf2_name (die, cu);
  if (!name)
    {
      complaint (&symfile_complaints,
                 _("DW_AT_name missing from DW_TAG_base_type"));
    }

(That generates a warning when "set complaints" is enabled, which normally it
isn't.  I don't know the history behind that complaint.)

and a quick hack to NULL out the name when it is "sizetype" results in:

 (gdb) ptype sizetype
 type = <invalid type code 8>

Reply via email to