Fix TYPE_SPECIFIC_FIELD for types created via arch_type
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 6 Sep 2016 15:25:31 +0000 (17:25 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 6 Sep 2016 15:25:31 +0000 (17:25 +0200)
commitae438bc5c06b770c00f37e4ed244707ce3ab9ff4
tree71d6daa5077e18170324f6b5a00a431783588206
parent5f3bceb68dd211be977eb61d5f1ea68e7de51b7a
Fix TYPE_SPECIFIC_FIELD for types created via arch_type

A type's TYPE_SPECIFIC_FIELD is supposed to be initialized as appropriate
for the type code.  This does happen if the type is created via init_type,
but not if it created via arch_type.

Fixed by extracting the initialization logic into a new set_type_code
routine, which is then called from both places.

gdb/ChangeLog:

* gdbtypes.c (set_type_code): New function.
(init_type, arch_type): Use it.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
gdb/ChangeLog
gdb/gdbtypes.c