This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Move builtinin_type_int{0 .. 128} out of arch vector
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 07 Aug 2004 15:26:59 -0400
- Subject: [commit] Move builtinin_type_int{0 .. 128} out of arch vector
Hello,
Turns out that the builtin_type_int0 et.al. (constant size / sign) types
didn't need to be in the architecture vector. This moves them out.
committed,
Andrew
2004-08-07 Andrew Cagney <cagney@gnu.org>
* 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.
Index: d10v-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/d10v-tdep.c,v
retrieving revision 1.147
diff -p -u -r1.147 d10v-tdep.c
--- d10v-tdep.c 31 Jul 2004 21:53:17 -0000 1.147
+++ d10v-tdep.c 7 Aug 2004 19:23:28 -0000
@@ -287,9 +287,9 @@ d10v_register_type (struct gdbarch *gdba
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
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.88
diff -p -u -r1.88 gdbtypes.c
--- gdbtypes.c 28 Jul 2004 15:49:03 -0000 1.88
+++ gdbtypes.c 7 Aug 2004 19:23:30 -0000
@@ -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 *gdba
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);
Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.56
diff -p -u -r1.56 gdbtypes.h
--- gdbtypes.h 28 Jul 2004 15:49:03 -0000 1.56
+++ gdbtypes.h 7 Aug 2004 19:23:32 -0000
@@ -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 <intypes.h>. */
- /* 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. */