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]
Other format: [Raw text]

[PATCH] Some i386 cleanups


This garbage collects a few redundant macro's and a stray prototype.

Committed,

Mark

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.6352
diff -u -p -r1.6352 ChangeLog
--- ChangeLog	8 Sep 2004 14:31:10 -0000	1.6352
+++ ChangeLog	8 Sep 2004 14:43:17 -0000
@@ -1,5 +1,17 @@
 2004-09-08  Mark Kettenis  <kettenis@gnu.org>
 
+	* i386-tdep.h (FPC_REGNUM, FCTRL_REGNUM, FSTAT_REGNUM, FTAG_REGNUM)
+	(FISEG_REGNUM, FIOFF_REGNUM, FOSEG_REGNUM, FOOFF_REGNUM)
+	(FOP_REGNUM, XMM0_REGNUM, MXCSR_REGNUM): Remove macros.
+	(i386_frameless_signal_p): Remove prototype.
+	* i386-linux-nat.c (GETFPREGS_SUPPLIES): Remove macro.
+	(GETFPXREGS_SUPPLIES): Define using I386_ST0_REGNUM and
+	I386_SSE_NUM_REGS.
+	* i386-nto-tdep.c (i386nto_supply_gregset): Use I386_NUM_GREGS
+	instead of FP0_REGNUM.
+	(i386nto_regset_id): Use I386_NUM_GREGS and I386_NUM_FREGS instead
+	of FP0_REGNUM and FPC_REGNUM.
+
 	* solib-sunos.c (sunos_relocate_main_executable): Remove function.
 	(sunos_solib_create_inferior_hook): Don't call
 	sunos_relocate_main_executable.
Index: i386-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.h,v
retrieving revision 1.40
diff -u -p -r1.40 i386-tdep.h
--- i386-tdep.h	30 Apr 2004 21:13:58 -0000	1.40
+++ i386-tdep.h	8 Sep 2004 14:43:17 -0000
@@ -111,48 +111,11 @@ struct gdbarch_tdep
    (at most) in the FPU, but are zero-extended to 32 bits in GDB's
    register cache.  */
 
-/* "Generic" floating point control register.  */
-#define FPC_REGNUM	(FP0_REGNUM + 8)
-
-/* FPU control word.  */
-#define FCTRL_REGNUM	FPC_REGNUM
-
-/* FPU status word.  */
-#define FSTAT_REGNUM	(FPC_REGNUM + 1)
-
-/* FPU register tag word.  */
-#define FTAG_REGNUM	(FPC_REGNUM + 2)
-
-/* FPU instruction's code segment selector, called "FPU Instruction
-   Pointer Selector" in the IA-32 manuals.  */
-#define FISEG_REGNUM	(FPC_REGNUM + 3)
-
-/* FPU instruction's offset within segment.  */
-#define FIOFF_REGNUM	(FPC_REGNUM + 4)
-
-/* FPU operand's data segment.  */
-#define FOSEG_REGNUM	(FPC_REGNUM + 5)
-
-/* FPU operand's offset within segment */
-#define FOOFF_REGNUM	(FPC_REGNUM + 6)
-
-/* FPU opcode, bottom eleven bits.  */
-#define FOP_REGNUM	(FPC_REGNUM + 7)
-
 /* Return non-zero if REGNUM matches the FP register and the FP
    register set is active.  */
 extern int i386_fp_regnum_p (int regnum);
 extern int i386_fpc_regnum_p (int regnum);
 
-/* SSE registers.  */
-
-/* First SSE data register.  */
-#define XMM0_REGNUM	(FPC_REGNUM + 8)
-
-/* SSE control/status register.  */
-#define MXCSR_REGNUM \
-  (XMM0_REGNUM + gdbarch_tdep (current_gdbarch)->num_xmm_regs)
-
 /* Register numbers of various important registers.  */
 
 enum i386_regnum
@@ -188,10 +151,9 @@ enum i386_regnum
 
 /* Functions exported from i386-tdep.c.  */
 extern CORE_ADDR i386_pe_skip_trampoline_code (CORE_ADDR pc, char *name);
-extern int i386_frameless_signal_p (struct frame_info *frame);
 
-/* Return the name of register REG.  */
-extern char const *i386_register_name (int reg);
+/* Return the name of register REGNUM.  */
+extern char const *i386_register_name (int regnum);
 
 /* Return non-zero if REGNUM is a member of the specified group.  */
 extern int i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
Index: i386-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v
retrieving revision 1.60
diff -u -p -r1.60 i386-linux-nat.c
--- i386-linux-nat.c	14 Aug 2004 16:01:39 -0000	1.60
+++ i386-linux-nat.c	8 Sep 2004 14:43:17 -0000
@@ -62,13 +62,8 @@
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
 
-/* Prototypes for i387_supply_fsave etc.  */
 #include "i387-tdep.h"
-
-/* Defines for XMM0_REGNUM etc. */
 #include "i386-tdep.h"
-
-/* Defines I386_LINUX_ORIG_EAX_REGNUM.  */
 #include "i386-linux-tdep.h"
 
 /* Defines ps_err_e, struct ps_prochandle.  */
@@ -111,11 +106,8 @@ static int regmap[] = 
 #define GETREGS_SUPPLIES(regno) \
   ((0 <= (regno) && (regno) <= 15) || (regno) == I386_LINUX_ORIG_EAX_REGNUM)
 
-#define GETFPREGS_SUPPLIES(regno) \
-  (FP0_REGNUM <= (regno) && (regno) <= LAST_FPU_CTRL_REGNUM)
-
 #define GETFPXREGS_SUPPLIES(regno) \
-  (FP0_REGNUM <= (regno) && (regno) <= MXCSR_REGNUM)
+  (I386_ST0_REGNUM <= (regno) && (regno) < I386_SSE_NUM_REGS)
 
 /* Does the current host support the GETREGS request?  */
 int have_ptrace_getregs =
Index: i386-nto-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-nto-tdep.c,v
retrieving revision 1.13
diff -u -p -r1.13 i386-nto-tdep.c
--- i386-nto-tdep.c	24 Jul 2004 01:00:19 -0000	1.13
+++ i386-nto-tdep.c	8 Sep 2004 14:43:17 -0000
@@ -73,7 +73,7 @@ i386nto_supply_gregset (char *gpregs)
   unsigned regno;
   int empty = 0;
 
-  for (regno = 0; regno < FP0_REGNUM; regno++)
+  for (regno = 0; regno < I386_NUM_GREGS; regno++)
     {
       int offset = nto_reg_offset (regno);
       if (offset == -1)
@@ -111,9 +111,9 @@ i386nto_regset_id (int regno)
 {
   if (regno == -1)
     return NTO_REG_END;
-  else if (regno < FP0_REGNUM)
+  else if (regno < I386_NUM_GREGS)
     return NTO_REG_GENERAL;
-  else if (regno < FPC_REGNUM)
+  else if (regno < I386_NUM_GREGS + I386_NUM_FREGS)
     return NTO_REG_FLOAT;
 
   return -1;			/* Error.  */


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