diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2016-09-06 17:26:32 +0200 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2016-09-06 17:26:32 +0200 |
commit | 88dfca6c43c11dea69db24cfb87e6821e63e29b2 (patch) | |
tree | 0efdcd0b229d16125cbf2423247685231a9bba28 /gdb/m32c-tdep.c | |
parent | ae438bc5c06b770c00f37e4ed244707ce3ab9ff4 (diff) | |
download | gdb-88dfca6c43c11dea69db24cfb87e6821e63e29b2.zip gdb-88dfca6c43c11dea69db24cfb87e6821e63e29b2.tar.gz gdb-88dfca6c43c11dea69db24cfb87e6821e63e29b2.tar.bz2 |
Add some missing arch_..._type helpers
gdbtypes provides a number of helper routines that can be called instead of
using arch_type directly to create a type of a particular kind. This patch
adds two additional such routines that have been missing so far, to allow
creation of TYPE_CODE_DECFLOAT and TYPE_CODE_POINTER types.
The patch also changes a number of places to use the new helper routines
instead of calling arch_type directly. No functional change intended.
gdb/ChangeLog:
* gdbtypes.h (arch_decfloat_type): New prototype.
(arch_pointer_type): Likewise.
* gdbtypes.c (arch_decfloat_type): New function.
(arch_pointer_type): Likewise.
(gdbtypes_post_init): Use arch_decfloat_type.
* avr-tdep.c (avr_gdbarch_init): Use arch_pointer_type.
* ft32-tdep.c (ft32_gdbarch_init): Likewise.
* m32c-tdep.c (make_types): Likewise.
* rl78-tdep.c (rl78_gdbarch_init): Likewise.
Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Diffstat (limited to 'gdb/m32c-tdep.c')
-rw-r--r-- | gdb/m32c-tdep.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index 1e98f73..547c997 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -192,27 +192,18 @@ make_types (struct gdbarch *arch) this is called, so we avoid using them. */ tdep->voyd = arch_type (arch, TYPE_CODE_VOID, 1, "void"); tdep->ptr_voyd - = arch_type (arch, TYPE_CODE_PTR, gdbarch_ptr_bit (arch) / TARGET_CHAR_BIT, - NULL); - TYPE_TARGET_TYPE (tdep->ptr_voyd) = tdep->voyd; - TYPE_UNSIGNED (tdep->ptr_voyd) = 1; + = arch_pointer_type (arch, gdbarch_ptr_bit (arch), NULL, tdep->voyd); tdep->func_voyd = lookup_function_type (tdep->voyd); xsnprintf (type_name, sizeof (type_name), "%s_data_addr_t", gdbarch_bfd_arch_info (arch)->printable_name); tdep->data_addr_reg_type - = arch_type (arch, TYPE_CODE_PTR, data_addr_reg_bits / TARGET_CHAR_BIT, - xstrdup (type_name)); - TYPE_TARGET_TYPE (tdep->data_addr_reg_type) = tdep->voyd; - TYPE_UNSIGNED (tdep->data_addr_reg_type) = 1; + = arch_pointer_type (arch, data_addr_reg_bits, type_name, tdep->voyd); xsnprintf (type_name, sizeof (type_name), "%s_code_addr_t", gdbarch_bfd_arch_info (arch)->printable_name); tdep->code_addr_reg_type - = arch_type (arch, TYPE_CODE_PTR, code_addr_reg_bits / TARGET_CHAR_BIT, - xstrdup (type_name)); - TYPE_TARGET_TYPE (tdep->code_addr_reg_type) = tdep->func_voyd; - TYPE_UNSIGNED (tdep->code_addr_reg_type) = 1; + = arch_pointer_type (arch, code_addr_reg_bits, type_name, tdep->func_voyd); tdep->uint8 = arch_integer_type (arch, 8, 1, "uint8_t"); tdep->uint16 = arch_integer_type (arch, 16, 1, "uint16_t"); |