From e0902733a29726ba107c41980bdbd8500261c852 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 24 Aug 2018 11:03:45 -0400 Subject: [PATCH] Move builtin_uint24_t type to s12z-tdep.c --- gdb/gdbtypes.c | 4 ---- gdb/gdbtypes.h | 2 -- gdb/s12z-tdep.c | 16 +++++++++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 05bf7b1..65b1211 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -5402,10 +5402,6 @@ gdbtypes_post_init (struct gdbarch *gdbarch) = arch_integer_type (gdbarch, 16, 0, "int16_t"); builtin_type->builtin_uint16 = arch_integer_type (gdbarch, 16, 1, "uint16_t"); - builtin_type->builtin_int24 - = arch_integer_type (gdbarch, 24, 0, "int24_t"); - builtin_type->builtin_uint24 - = arch_integer_type (gdbarch, 24, 1, "uint24_t"); builtin_type->builtin_int32 = arch_integer_type (gdbarch, 32, 0, "int32_t"); builtin_type->builtin_uint32 diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index eb7c365..14059ab 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1611,8 +1611,6 @@ struct builtin_type struct type *builtin_uint8; struct type *builtin_int16; struct type *builtin_uint16; - struct type *builtin_int24; - struct type *builtin_uint24; struct type *builtin_int32; struct type *builtin_uint32; struct type *builtin_int64; diff --git a/gdb/s12z-tdep.c b/gdb/s12z-tdep.c index 5169025..48af422 100644 --- a/gdb/s12z-tdep.c +++ b/gdb/s12z-tdep.c @@ -76,6 +76,11 @@ static const int reg_perm[N_PHYSICAL_REGISTERS] = REG_CCW }; +struct gdbarch_tdep +{ + type *builtin_uint24; +}; + static const char * s12z_register_name (struct gdbarch *gdbarch, int regnum) { @@ -138,7 +143,10 @@ s12z_register_type (struct gdbarch *gdbarch, int reg_nr) case 2: return builtin_type (gdbarch)->builtin_uint16; case 3: - return builtin_type (gdbarch)->builtin_uint24; + { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + return tdep->builtin_uint24; + } case 4: return builtin_type (gdbarch)->builtin_uint32; default: @@ -347,10 +355,6 @@ constexpr gdb_byte s12z_break_insn[] = {0x00}; typedef BP_MANIPULATION (s12z_break_insn) s12z_breakpoint; -struct gdbarch_tdep -{ -}; - static struct gdbarch * s12z_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) @@ -358,6 +362,8 @@ s12z_gdbarch_init (struct gdbarch_info info, struct gdbarch_tdep *tdep = (struct gdbarch_tdep *) xmalloc (sizeof *tdep); struct gdbarch *gdbarch = gdbarch_alloc (&info, tdep); + tdep->builtin_uint24 = arch_integer_type (gdbarch, 24, 1, "uint24_t"); + /* Target data types. */ set_gdbarch_short_bit (gdbarch, 16); set_gdbarch_int_bit (gdbarch, 16); -- 2.7.4