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]

[commit] Zap more tm-mips.h macros


It goes on.

committed,
Andrew
2004-10-30  Andrew Cagney  <cagney@gnu.org>

	* mips-tdep.h: Add comments on registers.
	(MIPS_UNUSED_REGNUM): Define.
	* config/mips/tm-mips.h (ZERO_REGNUM, UNUSED_REGNUM)
	(T9_REGNUM, V0_REGNUM, A0_REGNUM): Delete.
	* irix5-nat.c, mipsv4-nat.c, mips-linux-tdep.c: Update.
	* mips-linux-nat.c, remote-mips.c: Update.

Index: irix5-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/irix5-nat.c,v
retrieving revision 1.34
diff -p -u -r1.34 irix5-nat.c
--- irix5-nat.c	3 Aug 2004 02:02:22 -0000	1.34
+++ irix5-nat.c	30 Oct 2004 22:34:56 -0000
@@ -182,7 +182,7 @@ get_longjmp_target (CORE_ADDR *pc)
   CORE_ADDR jb_addr;
 
   buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
-  jb_addr = read_register (A0_REGNUM);
+  jb_addr = read_register (MIPS_A0_REGNUM);
 
   if (target_read_memory (jb_addr + JB_PC * JB_ELEMENT_SIZE, buf,
 			  TARGET_PTR_BIT / TARGET_CHAR_BIT))
Index: mips-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-linux-nat.c,v
retrieving revision 1.7
diff -p -u -r1.7 mips-linux-nat.c
--- mips-linux-nat.c	2 Feb 2004 03:12:32 -0000	1.7
+++ mips-linux-nat.c	30 Oct 2004 22:34:56 -0000
@@ -24,13 +24,13 @@
 
 /* Pseudo registers can not be read.  ptrace does not provide a way to
    read (or set) PS_REGNUM, and there's no point in reading or setting
-   ZERO_REGNUM.  We also can not set BADVADDR, CAUSE, or FCRIR via
-   ptrace().  */
+   MIPS_ZERO_REGNUM.  We also can not set BADVADDR, CAUSE, or FCRIR
+   via ptrace().  */
 
 int
 mips_linux_cannot_fetch_register (int regno)
 {
-  if (regno > ZERO_REGNUM && regno < ZERO_REGNUM + 32)
+  if (regno > MIPS_ZERO_REGNUM && regno < MIPS_ZERO_REGNUM + 32)
     return 0;
   else if (regno >= mips_regnum (current_gdbarch)->fp0
 	   && regno <= mips_regnum (current_gdbarch)->fp0 + 32)
@@ -50,7 +50,7 @@ mips_linux_cannot_fetch_register (int re
 int
 mips_linux_cannot_store_register (int regno)
 {
-  if (regno > ZERO_REGNUM && regno < ZERO_REGNUM + 32)
+  if (regno > MIPS_ZERO_REGNUM && regno < MIPS_ZERO_REGNUM + 32)
     return 0;
   else if (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 32)
     return 0;
Index: mips-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-linux-tdep.c,v
retrieving revision 1.30
diff -p -u -r1.30 mips-linux-tdep.c
--- mips-linux-tdep.c	30 Oct 2004 14:31:19 -0000	1.30
+++ mips-linux-tdep.c	30 Oct 2004 22:34:57 -0000
@@ -76,7 +76,7 @@ mips_linux_get_longjmp_target (CORE_ADDR
   CORE_ADDR jb_addr;
   char buf[TARGET_PTR_BIT / TARGET_CHAR_BIT];
 
-  jb_addr = read_register (A0_REGNUM);
+  jb_addr = read_register (MIPS_A0_REGNUM);
 
   if (target_read_memory (jb_addr
 			  + MIPS_LINUX_JB_PC * MIPS_LINUX_JB_ELEMENT_SIZE,
@@ -129,7 +129,7 @@ supply_gregset (elf_gregset_t *gregsetp)
 		    (char *)(regp + EF_CP0_CAUSE));
 
   /* Fill inaccessible registers with zero.  */
-  regcache_raw_supply (current_regcache, UNUSED_REGNUM, zerobuf);
+  regcache_raw_supply (current_regcache, MIPS_UNUSED_REGNUM, zerobuf);
   for (regi = FIRST_EMBED_REGNUM; regi < LAST_EMBED_REGNUM; regi++)
     regcache_raw_supply (current_regcache, regi, zerobuf);
 }
@@ -367,7 +367,7 @@ mips64_linux_get_longjmp_target (CORE_AD
   void *buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
   int element_size = TARGET_PTR_BIT == 32 ? 4 : 8;
 
-  jb_addr = read_register (A0_REGNUM);
+  jb_addr = read_register (MIPS_A0_REGNUM);
 
   if (target_read_memory (jb_addr + MIPS64_LINUX_JB_PC * element_size,
 			  buf, TARGET_PTR_BIT / TARGET_CHAR_BIT))
@@ -408,7 +408,7 @@ mips64_supply_gregset (mips64_elf_gregse
 		       (char *)(regp + MIPS64_EF_CP0_CAUSE));
 
   /* Fill inaccessible registers with zero.  */
-  regcache_raw_supply (current_regcache, UNUSED_REGNUM, zerobuf);
+  regcache_raw_supply (current_regcache, MIPS_UNUSED_REGNUM, zerobuf);
   for (regi = FIRST_EMBED_REGNUM; regi < LAST_EMBED_REGNUM; regi++)
     regcache_raw_supply (current_regcache, regi, zerobuf);
 }
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.351
diff -p -u -r1.351 mips-tdep.c
--- mips-tdep.c	30 Oct 2004 22:11:17 -0000	1.351
+++ mips-tdep.c	30 Oct 2004 22:34:58 -0000
@@ -5375,10 +5375,6 @@ mips_dump_tdep (struct gdbarch *current_
 		      "mips_dump_tdep: TRACE_SET # %s\n",
 		      XSTRING (TRACE_SET (X, STATE)));
 #endif
-#ifdef UNUSED_REGNUM
-  fprintf_unfiltered (file,
-		      "mips_dump_tdep: UNUSED_REGNUM = %d\n", UNUSED_REGNUM);
-#endif
   fprintf_unfiltered (file,
 		      "mips_dump_tdep: VM_MIN_ADDRESS = %ld\n",
 		      (long) VM_MIN_ADDRESS);
Index: mips-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.h,v
retrieving revision 1.13
diff -p -u -r1.13 mips-tdep.h
--- mips-tdep.h	30 Oct 2004 20:54:54 -0000	1.13
+++ mips-tdep.h	30 Oct 2004 22:34:58 -0000
@@ -61,13 +61,20 @@ struct mips_regnum
 };
 extern const struct mips_regnum *mips_regnum (struct gdbarch *gdbarch);
 
+/* Register numbers of various important registers.  Note that some of
+   these values are "real" register numbers, and correspond to the
+   general registers of the machine, and some are "phony" register
+   numbers which are too large to be actual register numbers as far as
+   the user is concerned but do serve to get the desired values when
+   passed to read_register.  */
+
 enum
 {
-  MIPS_ZERO_REGNUM = 0,
+  MIPS_ZERO_REGNUM = 0,		/* Read-only register, always 0.  */
   MIPS_AT_REGNUM = 1,
-  MIPS_V0_REGNUM = 2,
-  MIPS_A0_REGNUM = 4,
-  MIPS_T9_REGNUM = 25,
+  MIPS_V0_REGNUM = 2,		/* Function integer return value.  */
+  MIPS_A0_REGNUM = 4,		/* Loc of first arg during a subr call */
+  MIPS_T9_REGNUM = 25,		/* Contains address of callee in PIC.  */
   MIPS_SP_REGNUM = 29,
   MIPS_RA_REGNUM = 31,
   MIPS_EMBED_LO_REGNUM = 33,
@@ -75,7 +82,8 @@ enum
   MIPS_EMBED_BADVADDR_REGNUM = 35,
   MIPS_EMBED_CAUSE_REGNUM = 36,
   MIPS_EMBED_PC_REGNUM = 37,
-  MIPS_EMBED_FP0_REGNUM = 38
+  MIPS_EMBED_FP0_REGNUM = 38,
+  MIPS_UNUSED_REGNUM = 73	/* Never used, FIXME */
 };
 
 /* Defined in mips-tdep.c and used in remote-mips.c */
Index: mipsv4-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/mipsv4-nat.c,v
retrieving revision 1.17
diff -p -u -r1.17 mipsv4-nat.c
--- mipsv4-nat.c	3 Aug 2004 00:57:26 -0000	1.17
+++ mipsv4-nat.c	30 Oct 2004 22:34:58 -0000
@@ -68,7 +68,7 @@ supply_gregset (gregset_t *gregsetp)
 		       mips_regnum (current_gdbarch)->badvaddr,
 		       zerobuf);
   regcache_raw_supply (current_regcache, DEPRECATED_FP_REGNUM, zerobuf);
-  regcache_raw_supply (current_regcache, UNUSED_REGNUM, zerobuf);
+  regcache_raw_supply (current_regcache, MIPS_UNUSED_REGNUM, zerobuf);
   for (regi = FIRST_EMBED_REGNUM; regi <= LAST_EMBED_REGNUM; regi++)
     regcache_raw_supply (current_regcache, regi, zerobuf);
 }
@@ -161,7 +161,7 @@ get_longjmp_target (CORE_ADDR *pc)
   CORE_ADDR jb_addr;
 
   buf = alloca (TARGET_PTR_BIT / TARGET_CHAR_BIT);
-  jb_addr = read_register (A0_REGNUM);
+  jb_addr = read_register (MIPS_A0_REGNUM);
 
   if (target_read_memory (jb_addr + _JB_PC * JB_ELEMENT_SIZE, buf,
 			  TARGET_PTR_BIT / TARGET_CHAR_BIT))
Index: remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.54
diff -p -u -r1.54 remote-mips.c
--- remote-mips.c	30 Oct 2004 20:54:54 -0000	1.54
+++ remote-mips.c	30 Oct 2004 22:35:01 -0000
@@ -1905,7 +1905,7 @@ mips_fetch_registers (int regno)
       return;
     }
 
-  if (regno == DEPRECATED_FP_REGNUM || regno == ZERO_REGNUM)
+  if (regno == DEPRECATED_FP_REGNUM || regno == MIPS_ZERO_REGNUM)
     /* DEPRECATED_FP_REGNUM on the mips is a hack which is just
        supposed to read zero (see also mips-nat.c).  */
     val = 0;
Index: config/mips/tm-mips.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/tm-mips.h,v
retrieving revision 1.66
diff -p -u -r1.66 tm-mips.h
--- config/mips/tm-mips.h	30 Oct 2004 22:11:18 -0000	1.66
+++ config/mips/tm-mips.h	30 Oct 2004 22:35:01 -0000
@@ -43,20 +43,8 @@ extern int mips_step_skips_delay (CORE_A
 #define STEP_SKIPS_DELAY_P (1)
 #define STEP_SKIPS_DELAY(pc) (mips_step_skips_delay (pc))
 
-/* Register numbers of various important registers.
-   Note that some of these values are "real" register numbers,
-   and correspond to the general registers of the machine,
-   and some are "phony" register numbers which are too large
-   to be actual register numbers as far as the user is concerned
-   but do serve to get the desired values when passed to read_register.  */
-
-#define ZERO_REGNUM 0		/* read-only register, always 0 */
-#define V0_REGNUM 2		/* Function integer return value */
-#define A0_REGNUM 4		/* Loc of first arg during a subr call */
-#define T9_REGNUM 25		/* Contains address of callee in PIC */
 #define RA_REGNUM 31		/* Contains return address value */
 #define PS_REGNUM 32		/* Contains processor status */
-#define	UNUSED_REGNUM 73	/* Never used, FIXME */
 #define	FIRST_EMBED_REGNUM 74	/* First CP0 register for embedded use */
 #define	PRID_REGNUM 89		/* Processor ID */
 #define	LAST_EMBED_REGNUM 89	/* Last one */

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