From 980714f9c8e5218c0184ad9c46d68843a945f228 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 20 Mar 1998 07:50:33 +0000 Subject: [PATCH] Add builtin explicitly sized 8, 16, 32, 64 and 128 bit int and unsigned types. Specify size of r5900 FSR using 32 bit unsigned type. Correctly format mips registers when some are not 64 bits in size Check that REGISTER_{RAW,VIRTUAL}_SIZE are consistent when the target specifies that no conversion is needed when moving from one to the other. --- gdb/ChangeLog | 24 ++++++++++++++++++++++ gdb/gdbtypes.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ gdb/gdbtypes.h | 15 ++++++++++++++ 3 files changed, 93 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 36e0d08bcbe..65f4dec3da2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,27 @@ +Fri Mar 20 09:04:06 1998 Andrew Cagney + +start-sanitize-r5900 + * config/mips/tm-r5900.h (REGISTER_VIRTUAL_SIZE): Redefine as + expression from REGISTER_VIRTUAL_TYPE. + (REGISTER_RAW_SIZE): Ditto. + (REGISTER_VIRTUAL_TYPE): Redefine, use explicit size for 32 bit + registers. + +end-sanitize-r5900 + * gdbtypes.h (builtin_type_{,u}int{8,16,32,64}): New gdb builtin + types. +start-sanitize-r5900 + (builtin_type_{,u}int128): Ditto. +end-sanitize-r5900 + + * gdbtypes.c (_initialize_gdbtypes): Initialize new types. + + * mips-tdep.c (do_gp_register_row): Pad register value when GP + register is smaller than MIPS_REGSIZE. + + * findvar.c (value_of_register): When raw and virtual register + values identical, check that sizes are consistent. + Thu Mar 19 11:32:15 1998 Michael Snyder (msnyder@cleaver.cygnus.com) * minsyms.c (compare_minimal_symbols): If addresses are identical, diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index d1bfa98ba3d..1c3bbf2b364 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -53,6 +53,18 @@ struct type *builtin_type_long_double; struct type *builtin_type_complex; struct type *builtin_type_double_complex; struct type *builtin_type_string; +struct type *builtin_type_int8; +struct type *builtin_type_uint8; +struct type *builtin_type_int16; +struct type *builtin_type_uint16; +struct type *builtin_type_int32; +struct type *builtin_type_uint32; +struct type *builtin_type_int64; +struct type *builtin_type_uint64; +/* start-sanitize-r5900 */ +struct type *builtin_type_int128; +struct type *builtin_type_uint128; +/* end-sanitize-r5900 */ struct extra { char str[128]; int len; }; /* maximum extention is 128! FIXME */ @@ -1922,4 +1934,46 @@ _initialize_gdbtypes () init_type (TYPE_CODE_STRING, TARGET_CHAR_BIT / TARGET_CHAR_BIT, 0, "string", (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); + /* start-sanitize-r5900 */ + 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); + /* end-sanitize-r5900 */ } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 37270f5cfa1..4c354fecc44 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -626,6 +626,7 @@ allocate_cplus_struct_type PARAMS ((struct type *)); #define TYPE_FN_FIELD_VIRTUAL_P(thisfn, n) ((thisfn)[n].voffset > 1) #define TYPE_FN_FIELD_STATIC_P(thisfn, n) ((thisfn)[n].voffset == VOFFSET_STATIC) +/* Implicit sizes */ extern struct type *builtin_type_void; extern struct type *builtin_type_char; extern struct type *builtin_type_short; @@ -643,6 +644,20 @@ extern struct type *builtin_type_complex; extern struct type *builtin_type_double_complex; extern struct type *builtin_type_string; +/* Explicit sizes - see for naming schema */ +extern struct type *builtin_type_int8; +extern struct type *builtin_type_uint8; +extern struct type *builtin_type_int16; +extern struct type *builtin_type_uint16; +extern struct type *builtin_type_int32; +extern struct type *builtin_type_uint32; +extern struct type *builtin_type_int64; +extern struct type *builtin_type_uint64; +/* start-sanitize-r5900 */ +extern struct type *builtin_type_int128; +extern struct type *builtin_type_uint128; +/* end-sanitize-r5900 */ + /* This type represents a type that was unrecognized in symbol read-in. */ -- 2.30.2