gdbtypes.c (copy_type_recursive): Handle all TYPE_SPECIFIC_FIELD kinds.

gdb/ChangeLog:

	* gdbtypes.c (copy_type_recursive): Handle all TYPE_SPECIFIC_FIELD
	kinds.
This commit is contained in:
Doug Evans 2015-01-31 21:13:02 -08:00
parent 6779e036f5
commit f6b3afbf2f
2 changed files with 28 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2015-01-31 Doug Evans <xdje42@gmail.com>
* gdbtypes.c (copy_type_recursive): Handle all TYPE_SPECIFIC_FIELD
kinds.
2015-01-31 Gary Benson <gbenson@redhat.com> 2015-01-31 Gary Benson <gbenson@redhat.com>
Doug Evans <dje@google.com> Doug Evans <dje@google.com>

View File

@ -4217,18 +4217,35 @@ copy_type_recursive (struct objfile *objfile,
copy_type_recursive (objfile, copy_type_recursive (objfile,
TYPE_VPTR_BASETYPE (type), TYPE_VPTR_BASETYPE (type),
copied_types); copied_types);
/* Maybe copy the type_specific bits. /* Maybe copy the type_specific bits.
NOTE drow/2005-12-09: We do not copy the C++-specific bits like NOTE drow/2005-12-09: We do not copy the C++-specific bits like
base classes and methods. There's no fundamental reason why we base classes and methods. There's no fundamental reason why we
can't, but at the moment it is not needed. */ can't, but at the moment it is not needed. */
if (TYPE_CODE (type) == TYPE_CODE_FLT) switch (TYPE_SPECIFIC_FIELD (type))
TYPE_FLOATFORMAT (new_type) = TYPE_FLOATFORMAT (type); {
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT case TYPE_SPECIFIC_NONE:
|| TYPE_CODE (type) == TYPE_CODE_UNION break;
|| TYPE_CODE (type) == TYPE_CODE_NAMESPACE) case TYPE_SPECIFIC_FUNC:
INIT_CPLUS_SPECIFIC (new_type); INIT_FUNC_SPECIFIC (new_type);
TYPE_CALLING_CONVENTION (new_type) = TYPE_CALLING_CONVENTION (type);
TYPE_NO_RETURN (new_type) = TYPE_NO_RETURN (type);
TYPE_TAIL_CALL_LIST (new_type) = NULL;
break;
case TYPE_SPECIFIC_FLOATFORMAT:
TYPE_FLOATFORMAT (new_type) = TYPE_FLOATFORMAT (type);
break;
case TYPE_SPECIFIC_CPLUS_STUFF:
INIT_CPLUS_SPECIFIC (new_type);
break;
case TYPE_SPECIFIC_GNAT_STUFF:
INIT_GNAT_SPECIFIC (new_type);
break;
default:
gdb_assert_not_reached ("bad type_specific_kind");
}
return new_type; return new_type;
} }