This is the mail archive of the gdb-patches@sourceware.org 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]

[rfc] [4/6] Get rid of current_gdbarch in sparc target.


Hi,

this patch gets rid of some of the current_gdbarch's in sparc target.

Is this ok to commit?

ChangeLog:


* sparc-tdep.c (sparc_supply_rwindow, sparc_collect_rwindow): Use get_regcache_arch to get at the current architecture by regcache.

	* sparc64-tdep.c (sparc64_supply_gregset, sparc64_collect_gregset)
	(sparc64_supply_fpregset, sparc64_collect_fpregset): Use
	get_regcache_arch to get at the current architecture by regcache.

	* sparc64nbsd-nat. (sparc64nbsd_supply_gregset)
	(sparc64nbsd_collect_gregset, sparc64nbsd_supply_fpregset)
	(sparc64nbsd_collect_fpregset): Use get_regcache_arch to get at the
	current architecture by regcache.


-- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com



diff -urpN src/gdb/sparc64nbsd-nat.c dev/gdb/sparc64nbsd-nat.c
--- src/gdb/sparc64nbsd-nat.c	2007-08-23 20:08:38.000000000 +0200
+++ dev/gdb/sparc64nbsd-nat.c	2007-10-10 08:50:15.000000000 +0200
@@ -34,7 +34,7 @@ sparc64nbsd_supply_gregset (const struct
 			    struct regcache *regcache,
 			    int regnum, const void *gregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (current_gdbarch) == 32);
+  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
 
   if (sparc32)
     sparc32_supply_gregset (&sparc32nbsd_gregset, regcache, regnum, gregs);
@@ -47,7 +47,7 @@ sparc64nbsd_collect_gregset (const struc
 			     const struct regcache *regcache,
 			     int regnum, void *gregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (current_gdbarch) == 32);
+  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
 
   if (sparc32)
     sparc32_collect_gregset (&sparc32nbsd_gregset, regcache, regnum, gregs);
@@ -59,7 +59,7 @@ static void
 sparc64nbsd_supply_fpregset (struct regcache *regcache,
 			     int regnum, const void *fpregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (current_gdbarch) == 32);
+  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
 
   if (sparc32)
     sparc32_supply_fpregset (regcache, regnum, fpregs);
@@ -71,7 +71,7 @@ static void
 sparc64nbsd_collect_fpregset (const struct regcache *regcache,
 			      int regnum, void *fpregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (current_gdbarch) == 32);
+  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
 
   if (sparc32)
     sparc32_collect_fpregset (regcache, regnum, fpregs);
diff -urpN src/gdb/sparc64-tdep.c dev/gdb/sparc64-tdep.c
--- src/gdb/sparc64-tdep.c	2007-08-23 20:08:38.000000000 +0200
+++ dev/gdb/sparc64-tdep.c	2007-10-10 08:48:23.000000000 +0200
@@ -1170,7 +1170,7 @@ sparc64_supply_gregset (const struct spa
 			struct regcache *regcache,
 			int regnum, const void *gregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (current_gdbarch) == 32);
+  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
   const gdb_byte *regs = gregs;
   int i;
 
@@ -1284,7 +1284,7 @@ sparc64_collect_gregset (const struct sp
 			 const struct regcache *regcache,
 			 int regnum, void *gregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (current_gdbarch) == 32);
+  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
   gdb_byte *regs = gregs;
   int i;
 
@@ -1391,7 +1391,7 @@ void
 sparc64_supply_fpregset (struct regcache *regcache,
 			 int regnum, const void *fpregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (current_gdbarch) == 32);
+  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
   const gdb_byte *regs = fpregs;
   int i;
 
@@ -1426,7 +1426,7 @@ void
 sparc64_collect_fpregset (const struct regcache *regcache,
 			  int regnum, void *fpregs)
 {
-  int sparc32 = (gdbarch_ptr_bit (current_gdbarch) == 32);
+  int sparc32 = (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 32);
   gdb_byte *regs = fpregs;
   int i;
 
diff -urpN src/gdb/sparc-tdep.c dev/gdb/sparc-tdep.c
--- src/gdb/sparc-tdep.c	2007-08-23 20:08:38.000000000 +0200
+++ dev/gdb/sparc-tdep.c	2007-10-10 08:46:19.000000000 +0200
@@ -1532,7 +1532,7 @@ sparc_supply_rwindow (struct regcache *r
 
       /* Clear out the top half of the temporary buffer, and put the
 	 register value in the bottom half if we're in 64-bit mode.  */
-      if (gdbarch_ptr_bit (current_gdbarch) == 64)
+      if (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 64)
 	{
 	  memset (buf, 0, 4);
 	  offset = 4;
@@ -1599,7 +1599,7 @@ sparc_collect_rwindow (const struct regc
       sp &= 0xffffffffUL;
 
       /* Only use the bottom half if we're in 64-bit mode.  */
-      if (gdbarch_ptr_bit (current_gdbarch) == 64)
+      if (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 64)
 	offset = 4;
 
       for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)



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