From 449a5da47c55d448f0fc820d3e76c2100f496ab6 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 23 Jun 2003 21:05:40 +0000 Subject: [PATCH] 2003-06-23 Andrew Cagney * rs6000-tdep.c (rs6000_register_virtual_type): Add explict cases for 0 "int0" and 4 "int32" sized registers. * gdbtypes.c (builtin_type_int0): Define. (build_gdbtypes): Initialize builtin_type_int0. * gdbtypes.h (builtin_type_int0): Declare. --- gdb/ChangeLog | 8 ++++++++ gdb/gdbtypes.c | 5 +++++ gdb/gdbtypes.h | 5 ++++- gdb/rs6000-tdep.c | 8 ++++++-- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e473ab3185..e7d32b2ea4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2003-06-23 Andrew Cagney + + * rs6000-tdep.c (rs6000_register_virtual_type): Add explict cases + for 0 "int0" and 4 "int32" sized registers. + * gdbtypes.c (builtin_type_int0): Define. + (build_gdbtypes): Initialize builtin_type_int0. + * gdbtypes.h (builtin_type_int0): Declare. + 2003-06-23 Stephane Carrez * m68hc11-tdep.c (m68hc11_gdbarch_init): Clear gdb_arch_char_signed diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 3889afc860..4ce6cc739f 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -60,6 +60,7 @@ 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_int0; struct type *builtin_type_int8; struct type *builtin_type_uint8; struct type *builtin_type_int16; @@ -3410,6 +3411,10 @@ 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, diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 847e23aba8..e7d755a174 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -956,7 +956,10 @@ extern struct type *builtin_type_CORE_ADDR; (cf MIPS). */ extern struct type *builtin_type_bfd_vma; -/* Explicit sizes - see C9X for naming scheme */ +/* Explicit sizes - see C9X for naming scheme. The "int0" + is for when an architecture needs to describe a register that has + no size. */ +extern struct type *builtin_type_int0; extern struct type *builtin_type_int8; extern struct type *builtin_type_uint8; extern struct type *builtin_type_int16; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index e12a6bea38..d384d42a82 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1894,6 +1894,10 @@ rs6000_register_virtual_type (int n) int size = regsize (reg, tdep->wordsize); switch (size) { + case 0: + return builtin_type_int0; + case 4: + return builtin_type_int32; case 8: if (tdep->ppc_ev0_regnum <= n && n <= tdep->ppc_ev31_regnum) return builtin_type_vec64; @@ -1904,8 +1908,8 @@ rs6000_register_virtual_type (int n) return builtin_type_vec128; break; default: - return builtin_type_int32; - break; + internal_error (__FILE__, __LINE__, "Register %d size %d unknown", + n, size); } } } -- 2.34.1