From 2c10d744f336cd5e553000c20813102ed6d6d0fd Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 13 Nov 2001 02:39:29 +0000 Subject: [PATCH] Zap REGISTER_CONVERTIBLE from m88k. --- gdb/ChangeLog | 9 +++++++++ gdb/config/m88k/tm-m88k.h | 33 ++------------------------------- gdb/m88k-tdep.c | 13 +++++++++++++ 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d7f2111ac47..d29e0471485 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2001-11-10 Andrew Cagney + + * m88k-tdep.c (m88k_register_type): New function. + * config/m88k/tm-m88k.h (REGISTER_CONVERTIBLE): Delete. + (REGISTER_CONVERT_TO_VIRTUAL): Delete. + (REGISTER_CONVERT_TO_RAW): Delete. + (m88k_register_type): Declare. + (REGISTER_VIRTUAL_TYPE): Update. Call m88k_register_type. + 2001-11-11 Mark Kettenis * i386-tdep.h (FPU_REG_RAW_SIZE): Define unconditionally. diff --git a/gdb/config/m88k/tm-m88k.h b/gdb/config/m88k/tm-m88k.h index f3afc9e6f20..37bd2602d68 100644 --- a/gdb/config/m88k/tm-m88k.h +++ b/gdb/config/m88k/tm-m88k.h @@ -380,40 +380,11 @@ if (!target_is_m88110) \ #define MAX_REGISTER_VIRTUAL_SIZE (REGISTER_RAW_SIZE(XFP_REGNUM)) - /* Nonzero if register N requires conversion - from raw format to virtual format. */ - -#define REGISTER_CONVERTIBLE(N) ((N) >= XFP_REGNUM) - -#include "floatformat.h" - -/* Convert data from raw format for register REGNUM in buffer FROM - to virtual format with type TYPE in buffer TO. */ - -#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ -{ \ - DOUBLEST val; \ - floatformat_to_doublest (&floatformat_m88110_ext, (FROM), &val); \ - store_floating ((TO), TYPE_LENGTH (TYPE), val); \ -} - -/* Convert data from virtual format with type TYPE in buffer FROM - to raw format for register REGNUM in buffer TO. */ - -#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ -{ \ - DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \ - floatformat_from_doublest (&floatformat_m88110_ext, &val, (TO)); \ -} - /* Return the GDB type object for the "standard" data type of data in register N. */ -#define REGISTER_VIRTUAL_TYPE(N) \ -((N) >= XFP_REGNUM \ - ? builtin_type_double \ - : ((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM \ - ? lookup_pointer_type (builtin_type_void) : builtin_type_int)) +struct type *m88k_register_type (int regnum); +#define REGISTER_VIRTUAL_TYPE(N) m88k_register_type (N) /* The 88k call/return conventions call for "small" values to be returned into consecutive registers starting from r2. */ diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index 195722b2254..86ca0982bfe 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -39,6 +39,19 @@ void frame_find_saved_regs (); int target_is_m88110 = 0; +/* The type of a register. */ +struct type * +m88k_register_type (int regnum) +{ + if (regnum >= XFP_REGNUM) + return builtin_type_m88110_ext; + else if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM) + return builtin_type_void_func_ptr; + else + return builtin_type_int32; +} + + /* The m88k kernel aligns all instructions on 4-byte boundaries. The kernel also uses the least significant two bits for its own hocus pocus. When gdb receives an address from the kernel, it needs to -- 2.30.2