From 032758dc555081e5b39bd684ada37b8571a9a729 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Wed, 14 Nov 2001 08:18:33 +0000 Subject: [PATCH] * arm-tdep.c (arm_register_type): New function. (arm_register_convertible): Delete. (arm_register_convert_to_virtual): Delete. (arm_register_convert_to_raw): Delete. * config/arm/tm-arm.h (REGISTER_CONVERTIBLE): Delete. (REGISTER_CONVERT_TO_VIRTUAL): Delete. (REGISTER_CONVERT_TO_RAW): Delete. (REGISTER_VIRTUAL_TYPE): Redefine as call to arm_register_type. (arm_register_type): Declare. --- gdb/ChangeLog | 12 +++++++++++ gdb/arm-tdep.c | 48 ++++++++++++----------------------------- gdb/config/arm/tm-arm.h | 28 ++---------------------- 3 files changed, 28 insertions(+), 60 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 00bdcb74be4..648d7e3aa78 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2001-11-10 Andrew Cagney + + * arm-tdep.c (arm_register_type): New function. + (arm_register_convertible): Delete. + (arm_register_convert_to_virtual): Delete. + (arm_register_convert_to_raw): Delete. + * config/arm/tm-arm.h (REGISTER_CONVERTIBLE): Delete. + (REGISTER_CONVERT_TO_VIRTUAL): Delete. + (REGISTER_CONVERT_TO_RAW): Delete. + (REGISTER_VIRTUAL_TYPE): Redefine as call to arm_register_type. + (arm_register_type): Declare. + 2001-11-13 Elena Zannoni From Andrew Cagney : diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index d220e3d1ff7..4243fd7758c 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1437,6 +1437,20 @@ arm_float_info (void) print_fpu_flags (status); } +struct type * +arm_register_type (int regnum) +{ + if (regnum >= F0_REGNUM && regnum < F0_REGNUM + NUM_FREGS) + { + if (TARGET_BYTE_ORDER == BIG_ENDIAN) + return builtin_type_arm_ext_big; + else + return builtin_type_arm_ext_littlebyte_bigword; + } + else + return builtin_type_int32; +} + /* NOTE: cagney/2001-08-20: Both convert_from_extended() and convert_to_extended() use floatformat_arm_ext_littlebyte_bigword. It is thought that this is is the floating-point register format on @@ -1466,40 +1480,6 @@ convert_to_extended (void *dbl, void *ptr) &d, dbl); } -/* Nonzero if register N requires conversion from raw format to - virtual format. */ - -int -arm_register_convertible (unsigned int regnum) -{ - return ((regnum - F0_REGNUM) < 8); -} - -/* Convert data from raw format for register REGNUM in buffer FROM to - virtual format with type TYPE in buffer TO. */ - -void -arm_register_convert_to_virtual (unsigned int regnum, struct type *type, - void *from, void *to) -{ - double val; - - convert_from_extended (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. */ - -void -arm_register_convert_to_raw (unsigned int regnum, struct type *type, - void *from, void *to) -{ - double val = extract_floating (from, TYPE_LENGTH (type)); - - convert_to_extended (&val, to); -} - static int condition_true (unsigned long cond, unsigned long status_reg) { diff --git a/gdb/config/arm/tm-arm.h b/gdb/config/arm/tm-arm.h index b773adff671..e4271dae19e 100644 --- a/gdb/config/arm/tm-arm.h +++ b/gdb/config/arm/tm-arm.h @@ -268,35 +268,11 @@ extern char **arm_register_names; /* Largest value REGISTER_VIRTUAL_SIZE can have. */ #define MAX_REGISTER_VIRTUAL_SIZE FP_REGISTER_VIRTUAL_SIZE -/* Nonzero if register N requires conversion from raw format to - virtual format. */ -extern int arm_register_convertible (unsigned int); -#define REGISTER_CONVERTIBLE(REGNUM) (arm_register_convertible (REGNUM)) - -/* Convert data from raw format for register REGNUM in buffer FROM to - virtual format with type TYPE in buffer TO. */ - -extern void arm_register_convert_to_virtual (unsigned int regnum, - struct type *type, - void *from, void *to); -#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \ - arm_register_convert_to_virtual (REGNUM, TYPE, FROM, TO) - -/* Convert data from virtual format with type TYPE in buffer FROM to - raw format for register REGNUM in buffer TO. */ - -extern void arm_register_convert_to_raw (unsigned int regnum, - struct type *type, - void *from, void *to); -#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \ - arm_register_convert_to_raw (REGNUM, TYPE, FROM, TO) - /* Return the GDB type object for the "standard" data type of data in register N. */ -#define REGISTER_VIRTUAL_TYPE(N) \ - (((unsigned)(N) - F0_REGNUM) < NUM_FREGS \ - ? builtin_type_double : builtin_type_int) +extern struct type *arm_register_type (int regnum); +#define REGISTER_VIRTUAL_TYPE(N) arm_register_type (N) /* The system C compiler uses a similar structure return convention to gcc */ extern use_struct_convention_fn arm_use_struct_convention; -- 2.30.2