This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[rfc/m88k] Delete REGISTER_CONVERTIBLE() et.al. from m88k


Hello,

This is the same as for my previous ARM post.  I believe the change is 
correct.  It certainly still compiles.  Since this isn't maintained, 
I'll check it in, in a few days.

enjoy,
Andrew
2001-11-10  Andrew Cagney  <ac131313@redhat.com>

	* 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.

Index: m88k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m88k-tdep.c,v
retrieving revision 1.6
diff -p -r1.6 m88k-tdep.c
*** m88k-tdep.c	2001/04/02 14:47:21	1.6
--- m88k-tdep.c	2001/11/11 00:31:35
*************** void frame_find_saved_regs ();
*** 39,44 ****
--- 39,57 ----
  
  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
Index: config/m88k/tm-m88k.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m88k/tm-m88k.h,v
retrieving revision 1.8
diff -p -r1.8 tm-m88k.h
*** tm-m88k.h	2001/08/12 03:19:22	1.8
--- tm-m88k.h	2001/11/11 00:31:36
*************** if (!target_is_m88110) \
*** 380,419 ****
  
  #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))
  
  /* The 88k call/return conventions call for "small" values to be returned
     into consecutive registers starting from r2.  */
--- 380,390 ----
  
  #define MAX_REGISTER_VIRTUAL_SIZE (REGISTER_RAW_SIZE(XFP_REGNUM))
  
  /* Return the GDB type object for the "standard" data type
     of data in register N.  */
  
! 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.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]