Add builtin explicitly sized 8, 16, 32, 64 and 128 bit int and
authorAndrew Cagney <cagney@redhat.com>
Fri, 20 Mar 1998 07:50:33 +0000 (07:50 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 20 Mar 1998 07:50:33 +0000 (07:50 +0000)
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
gdb/gdbtypes.c
gdb/gdbtypes.h

index 36e0d08bcbe37b96616746a3283ead23284c38e2..65f4dec3da200b3dfba832578e298b6ced9b8ca4 100644 (file)
@@ -1,3 +1,27 @@
+Fri Mar 20 09:04:06 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+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,
index d1bfa98ba3dfe5fca28a5cbb4d08848b9ebe017c..1c3bbf2b3642e5e781bb5124bd2f933dd340e794 100644 (file)
@@ -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 */
 }
index 37270f5cfa1954c863075a75b5f5a63109ea36c5..4c354fecc44180d4cc090568aaa718749b1c5211 100644 (file)
@@ -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 <intypes.h> 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.  */