diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-07-02 12:55:30 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-07-02 12:55:30 +0000 |
commit | e9bb382b835d19c078eca9908ec6fe66f7af67fa (patch) | |
tree | b3edf217dc44f853806c33e23c67b21196e3241e /gdb/m32c-tdep.c | |
parent | 209bd28e8ba1a8d4f3f5e90ea954437050870837 (diff) | |
download | gdb-e9bb382b835d19c078eca9908ec6fe66f7af67fa.zip gdb-e9bb382b835d19c078eca9908ec6fe66f7af67fa.tar.gz gdb-e9bb382b835d19c078eca9908ec6fe66f7af67fa.tar.bz2 |
* gdbtypes.h (TYPE_OBJFILE_OWNED, TYPE_OWNER): New macros.
(TYPE_OBJFILE, TYPE_ALLOC, TYPE_ZALLOC): Reimplement.
(alloc_type_arch): Add prototype.
(alloc_type_copy): Likewise.
(get_type_arch): Likewise.
(arch_type): Likewise.
(arch_integer_type): Likewise.
(arch_character_type): Likewise.
(arch_boolean_type): Likewise.
(init_float_type): Remove, replace by ...
(arch_float_type): ... this.
(init_complex_type): Remove, replace by ...
(arch_complex_type): ... this.
(init_flags_type): Remove, replace by ...
(arch_flags_type): ... this.
(init_composite_type): Remove, replace by ...
(arch_composite_type): ... this.
* gdbtypes.c (alloc_type): No longer support NULL objfile.
(init_type): Likewise.
(alloc_type_arch): New function.
(alloc_type_copy): New function.
(get_type_arch): New function.
(smash_type): Preserve type ownership information.
(make_pointer_type, make_reference_type, make_function_type,
smash_to_memberptr_type, smash_to_method_type): No longer
preserve OBJFILE across smash_type calls.
(make_pointer_type, make_reference_type, make_function_type,
lookup_memberptr_type, lookup_methodptr_type, allocate_stub_method,
create_range_type, create_array_type, create_set_type, copy_type):
Use alloc_type_copy when allocating types.
(check_typedef): Use alloc_type_arch.
(copy_type_recursive): Likewise. Preserve type ownership data
after copying type.
(recursive_dump_type): Dump type ownership data.
(alloc_type_instance): Update type ownership check.
(copy_type, copy_type_recursive): Likewise.
(arch_type): New function.
(arch_integer_type): Likewise.
(arch_character_type): Likewise.
(arch_boolean_type): Likewise.
(init_float_type): Remove, replace by ...
(arch_float_type): ... this.
(init_complex_type): Remove, replace by ...
(arch_complex_type): ... this.
(init_flags_type): Remove, replace by ...
(arch_flags_type): ... this.
(append_flags_type_flag): Move down.
(init_composite_type): Remove, replace by ...
(arch_composite_type): ... this.
(append_composite_type_field_aligned,
append_composite_type_field): Move down.
* gdbarch.c (gdbtypes_post_init): Allocate all types
using per-architecture routines.
* ada-lang.c (ada_language_arch_info): Likewise.
* f-lang.c (build_fortran_types): Likewise.
* jv-lang.c (build_java_types): Likewise.
* m2-lang.c (build_m2_types): Likewise.
* scm-lang.c (build_scm_types): Likewise.
* ada-lang.c (ada_type_of_array): Use alloc_type_copy.
(packed_array_type): Likewise.
(ada_template_to_fixed_record_type_1): Likewise.
(template_to_static_fixed_type): Likewise.
(to_record_with_fixed_variant_part): Likewise.
(to_fixed_variant_branch_type): Likewise.
(to_fixed_array_type): Likewise.
(to_fixed_range_type): Likewise.
(empty_record): Use type instead of objfile argument.
Use alloc_type_copy.
(to_fixed_variant_branch_type): Update call to empty_record.
* jv-lang.c (type_from_class): Use alloc_type_arch.
* arm-tdep.c (arm_ext_type): Allocate per-architecture type.
* i386-tdep.c (i386_eflags_type, i386_mxcsr_type, i387_ext_type,
i386_mmx_type, i386_sse_type): Likewise.
* ia64-tdep.c (ia64_ext_type): Likewise.
* m32c-tdep.c (make_types): Likewise.
* m68k-tdep.c (m68k_ps_type, m68881_ext_type): Likewise.
* rs6000-tdep.c (rs6000_builtin_type_vec64,
rs6000_builtin_type_vec128): Likewise.
* sparc-tdep.c (sparc_psr_type, sparc_fsr_type): Likewise.
* sparc64-tdep.c (sparc64_pstate_type, sparc64_fsr_type,
sparc64_fprs_type): Likewise.
* spu-tdep.c (spu_builtin_type_vec128): Likewise.
* xtensa-tdep.c (xtensa_register_type): Likewise.
* linux-tdep.c (linux_get_siginfo_type): Likewise.
* target-descriptions.c (tdesc_gdb_type): Likewise.
* gnu-v3-abi.c (build_gdb_vtable_type): Likewise.
Diffstat (limited to 'gdb/m32c-tdep.c')
-rw-r--r-- | gdb/m32c-tdep.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index a833ef4..b67169f 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -192,34 +192,33 @@ make_types (struct gdbarch *arch) /* The builtin_type_mumble variables are sometimes uninitialized when this is called, so we avoid using them. */ - tdep->voyd = init_type (TYPE_CODE_VOID, 1, 0, "void", NULL); - tdep->ptr_voyd = init_type (TYPE_CODE_PTR, gdbarch_ptr_bit (arch) / 8, - TYPE_FLAG_UNSIGNED, NULL, NULL); + tdep->voyd = arch_type (arch, TYPE_CODE_VOID, 1, "void"); + tdep->ptr_voyd + = arch_type (arch, TYPE_CODE_PTR, gdbarch_ptr_bit (arch), NULL); TYPE_TARGET_TYPE (tdep->ptr_voyd) = tdep->voyd; + TYPE_UNSIGNED (tdep->ptr_voyd) = 1; tdep->func_voyd = lookup_function_type (tdep->voyd); sprintf (type_name, "%s_data_addr_t", gdbarch_bfd_arch_info (arch)->printable_name); tdep->data_addr_reg_type - = init_type (TYPE_CODE_PTR, data_addr_reg_bits / 8, - TYPE_FLAG_UNSIGNED, xstrdup (type_name), NULL); + = arch_type (arch, TYPE_CODE_PTR, data_addr_reg_bits, xstrdup (type_name)); TYPE_TARGET_TYPE (tdep->data_addr_reg_type) = tdep->voyd; + TYPE_UNSIGNED (tdep->data_addr_reg_type) = 1; sprintf (type_name, "%s_code_addr_t", gdbarch_bfd_arch_info (arch)->printable_name); tdep->code_addr_reg_type - = init_type (TYPE_CODE_PTR, code_addr_reg_bits / 8, - TYPE_FLAG_UNSIGNED, xstrdup (type_name), NULL); + = arch_type (arch, TYPE_CODE_PTR, code_addr_reg_bits, xstrdup (type_name)); TYPE_TARGET_TYPE (tdep->code_addr_reg_type) = tdep->func_voyd; - - tdep->uint8 = init_type (TYPE_CODE_INT, 1, TYPE_FLAG_UNSIGNED, - "uint8_t", NULL); - tdep->uint16 = init_type (TYPE_CODE_INT, 2, TYPE_FLAG_UNSIGNED, - "uint16_t", NULL); - tdep->int8 = init_type (TYPE_CODE_INT, 1, 0, "int8_t", NULL); - tdep->int16 = init_type (TYPE_CODE_INT, 2, 0, "int16_t", NULL); - tdep->int32 = init_type (TYPE_CODE_INT, 4, 0, "int32_t", NULL); - tdep->int64 = init_type (TYPE_CODE_INT, 8, 0, "int64_t", NULL); + TYPE_UNSIGNED (tdep->code_addr_reg_type) = 1; + + tdep->uint8 = arch_integer_type (arch, 8, 1, "uint8_t"); + tdep->uint16 = arch_integer_type (arch, 16, 1, "uint16_t"); + tdep->int8 = arch_integer_type (arch, 8, 0, "int8_t"); + tdep->int16 = arch_integer_type (arch, 16, 0, "int16_t"); + tdep->int32 = arch_integer_type (arch, 32, 0, "int32_t"); + tdep->int64 = arch_integer_type (arch, 64, 0, "int64_t"); } |