From 7ad6570da5242fbe15716986032ca353d6f59f96 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sat, 7 Aug 2004 19:25:58 +0000 Subject: [PATCH] 2004-08-07 Andrew Cagney * gdbtypes.h (struct builtin_type): Delete builtin_int0 through to builtin_uint128. * gdbtypes.c (gdbtypes_post_init): Update. (build_gdbtypes): Move initialization of builtin_type_int0 through to builtin_type_uint128 from here ... (_initialize_gdbtypes): ... to here. * d10v-tdep.c (d10v_register_type): Update. --- gdb/ChangeLog | 8 +++ gdb/d10v-tdep.c | 4 +- gdb/gdbtypes.c | 134 +++++++++++++++++------------------------------- gdb/gdbtypes.h | 19 ------- 4 files changed, 56 insertions(+), 109 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 051b616d81..f3924789aa 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2004-08-07 Andrew Cagney + * gdbtypes.h (struct builtin_type): Delete builtin_int0 through to + builtin_uint128. + * gdbtypes.c (gdbtypes_post_init): Update. + (build_gdbtypes): Move initialization of builtin_type_int0 + through to builtin_type_uint128 from here ... + (_initialize_gdbtypes): ... to here. + * d10v-tdep.c (d10v_register_type): Update. + * doublest.c: Update copyright. (floatformat_from_length): Call error when floatformat is NULL. (extract_floating_by_length): Remove NULL fmt check. diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 274f5db02a..ea44721c61 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -287,9 +287,9 @@ d10v_register_type (struct gdbarch *gdbarch, int reg_nr) return builtin_type (gdbarch)->builtin_data_ptr; else if (reg_nr >= a0_regnum (gdbarch) && reg_nr < (a0_regnum (gdbarch) + NR_A_REGS)) - return builtin_type (gdbarch)->builtin_int64; + return builtin_type_int64; else - return builtin_type (gdbarch)->builtin_int16; + return builtin_type_int16; } static int diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index d954bd55aa..4d00aab041 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -3215,50 +3215,6 @@ build_gdbtypes (void) init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "string", (struct objfile *) NULL); - builtin_type_int0 = - init_type (TYPE_CODE_INT, 0 / 8, - 0, - "int0_t", (struct objfile *) NULL); - builtin_type_int8 = - init_type (TYPE_CODE_INT, 8 / 8, - 0, - "int8_t", (struct objfile *) NULL); - builtin_type_uint8 = - init_type (TYPE_CODE_INT, 8 / 8, - TYPE_FLAG_UNSIGNED, - "uint8_t", (struct objfile *) NULL); - builtin_type_int16 = - init_type (TYPE_CODE_INT, 16 / 8, - 0, - "int16_t", (struct objfile *) NULL); - builtin_type_uint16 = - init_type (TYPE_CODE_INT, 16 / 8, - TYPE_FLAG_UNSIGNED, - "uint16_t", (struct objfile *) NULL); - builtin_type_int32 = - init_type (TYPE_CODE_INT, 32 / 8, - 0, - "int32_t", (struct objfile *) NULL); - builtin_type_uint32 = - init_type (TYPE_CODE_INT, 32 / 8, - TYPE_FLAG_UNSIGNED, - "uint32_t", (struct objfile *) NULL); - builtin_type_int64 = - init_type (TYPE_CODE_INT, 64 / 8, - 0, - "int64_t", (struct objfile *) NULL); - builtin_type_uint64 = - init_type (TYPE_CODE_INT, 64 / 8, - TYPE_FLAG_UNSIGNED, - "uint64_t", (struct objfile *) NULL); - builtin_type_int128 = - init_type (TYPE_CODE_INT, 128 / 8, - 0, - "int128_t", (struct objfile *) NULL); - builtin_type_uint128 = - init_type (TYPE_CODE_INT, 128 / 8, - TYPE_FLAG_UNSIGNED, - "uint128_t", (struct objfile *) NULL); builtin_type_bool = init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, @@ -3444,50 +3400,6 @@ gdbtypes_post_init (struct gdbarch *gdbarch) init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "string", (struct objfile *) NULL); - builtin_type->builtin_int0 = - init_type (TYPE_CODE_INT, 0 / 8, - 0, - "int0_t", (struct objfile *) NULL); - builtin_type->builtin_int8 = - init_type (TYPE_CODE_INT, 8 / 8, - 0, - "int8_t", (struct objfile *) NULL); - builtin_type->builtin_uint8 = - init_type (TYPE_CODE_INT, 8 / 8, - TYPE_FLAG_UNSIGNED, - "uint8_t", (struct objfile *) NULL); - builtin_type->builtin_int16 = - init_type (TYPE_CODE_INT, 16 / 8, - 0, - "int16_t", (struct objfile *) NULL); - builtin_type->builtin_uint16 = - init_type (TYPE_CODE_INT, 16 / 8, - TYPE_FLAG_UNSIGNED, - "uint16_t", (struct objfile *) NULL); - builtin_type->builtin_int32 = - init_type (TYPE_CODE_INT, 32 / 8, - 0, - "int32_t", (struct objfile *) NULL); - builtin_type->builtin_uint32 = - init_type (TYPE_CODE_INT, 32 / 8, - TYPE_FLAG_UNSIGNED, - "uint32_t", (struct objfile *) NULL); - builtin_type->builtin_int64 = - init_type (TYPE_CODE_INT, 64 / 8, - 0, - "int64_t", (struct objfile *) NULL); - builtin_type->builtin_uint64 = - init_type (TYPE_CODE_INT, 64 / 8, - TYPE_FLAG_UNSIGNED, - "uint64_t", (struct objfile *) NULL); - builtin_type->builtin_int128 = - init_type (TYPE_CODE_INT, 128 / 8, - 0, - "int128_t", (struct objfile *) NULL); - builtin_type->builtin_uint128 = - init_type (TYPE_CODE_INT, 128 / 8, - TYPE_FLAG_UNSIGNED, - "uint128_t", (struct objfile *) NULL); builtin_type->builtin_bool = init_type (TYPE_CODE_BOOL, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, @@ -3538,6 +3450,52 @@ void _initialize_gdbtypes (void) { struct cmd_list_element *c; + + builtin_type_int0 = + init_type (TYPE_CODE_INT, 0 / 8, + 0, + "int0_t", (struct objfile *) NULL); + builtin_type_int8 = + init_type (TYPE_CODE_INT, 8 / 8, + 0, + "int8_t", (struct objfile *) NULL); + builtin_type_uint8 = + init_type (TYPE_CODE_INT, 8 / 8, + TYPE_FLAG_UNSIGNED, + "uint8_t", (struct objfile *) NULL); + builtin_type_int16 = + init_type (TYPE_CODE_INT, 16 / 8, + 0, + "int16_t", (struct objfile *) NULL); + builtin_type_uint16 = + init_type (TYPE_CODE_INT, 16 / 8, + TYPE_FLAG_UNSIGNED, + "uint16_t", (struct objfile *) NULL); + builtin_type_int32 = + init_type (TYPE_CODE_INT, 32 / 8, + 0, + "int32_t", (struct objfile *) NULL); + builtin_type_uint32 = + init_type (TYPE_CODE_INT, 32 / 8, + TYPE_FLAG_UNSIGNED, + "uint32_t", (struct objfile *) NULL); + builtin_type_int64 = + init_type (TYPE_CODE_INT, 64 / 8, + 0, + "int64_t", (struct objfile *) NULL); + builtin_type_uint64 = + init_type (TYPE_CODE_INT, 64 / 8, + TYPE_FLAG_UNSIGNED, + "uint64_t", (struct objfile *) NULL); + builtin_type_int128 = + init_type (TYPE_CODE_INT, 128 / 8, + 0, + "int128_t", (struct objfile *) NULL); + builtin_type_uint128 = + init_type (TYPE_CODE_INT, 128 / 8, + TYPE_FLAG_UNSIGNED, + "uint128_t", (struct objfile *) NULL); + build_gdbtypes (); gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index bc3e5a3f20..a9d98dcbfd 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -946,25 +946,6 @@ struct builtin_type /* Integral types. */ - /* Explicit sizes. These are assumed to be 2's complement and in - the architecture's byte order. The "int0" is for when an ISA - needs to describe a register that has no size. The naming schema - is based on C9X . */ - /* FIXME: cagney/2004-07-26: As with floating-point, there should be - explicit big, little and little-byte-big-word endian types that - exist outside of the architecture vector. */ - struct type *builtin_int0; - struct type *builtin_int8; - struct type *builtin_uint8; - struct type *builtin_int16; - struct type *builtin_uint16; - struct type *builtin_int32; - struct type *builtin_uint32; - struct type *builtin_int64; - struct type *builtin_uint64; - struct type *builtin_int128; - struct type *builtin_uint128; - /* We use this for the '/c' print format, because c_char is just a one-byte integral type, which languages less laid back than C will print as ... well, a one-byte integral type. */ -- 2.34.1