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] Eliminate MIPS write_sp


As pointed out by RTH, this eliminates write_sp from the MIPS archiecture vector. It also updates the comment to reflect current reality.

committed,
Andrew
2003-06-01  Andrew Cagney  <cagney@redhat.com>

	* infcall.c (call_function_by_hand): Update comment on
	DEPRECATED_DUMMY_WRITE_SP.

	* mips-tdep.c (mips_gdbarch_init): Do not set
	deprecated_dummy_write_sp.
	(mips_eabi_push_dummy_call): Set the SP register.
	(mips_o64_push_dummy_call): Set the SP register.
	(mips_o32_push_dummy_call): Set the SP register.
	(mips_n32n64_push_dummy_call): Set the SP register.

Index: infcall.c
===================================================================
RCS file: /cvs/src/src/gdb/infcall.c,v
retrieving revision 1.13
diff -u -r1.13 infcall.c
--- infcall.c	31 May 2003 14:20:31 -0000	1.13
+++ infcall.c	1 Jun 2003 18:53:27 -0000
@@ -809,15 +809,16 @@
   if (struct_return && DEPRECATED_STORE_STRUCT_RETURN_P ())
     DEPRECATED_STORE_STRUCT_RETURN (struct_addr, sp);
 
-  /* Write the stack pointer.  This is here because the statements above
-     might fool with it.  On SPARC, this write also stores the register
-     window into the right place in the new stack frame, which otherwise
-     wouldn't happen.  (See store_inferior_registers in sparc-nat.c.)  */
-  /* NOTE: cagney/2003-03-23: Disable this code when there is a
-     push_dummy_call() method.  Since that method will have already
-     stored the stack pointer (as part of creating the fake call
-     frame), and none of the code following that code adjusts the
-     stack-pointer value, the below call is entirely redundant.  */
+  /* Write the stack pointer.  This is here because the statements
+     above might fool with it.  On SPARC, this write also stores the
+     register window into the right place in the new stack frame,
+     which otherwise wouldn't happen (see store_inferior_registers in
+     sparc-nat.c).  */
+  /* NOTE: cagney/2003-03-23: Since the architecture method
+     push_dummy_call() should have already stored the stack pointer
+     (as part of creating the fake call frame), and none of the code
+     following that call adjusts the stack-pointer value, the below
+     call is entirely redundant.  */
   if (DEPRECATED_DUMMY_WRITE_SP_P ())
     DEPRECATED_DUMMY_WRITE_SP (sp);
 
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.206
diff -u -r1.206 mips-tdep.c
--- mips-tdep.c	1 Jun 2003 15:45:57 -0000	1.206
+++ mips-tdep.c	1 Jun 2003 18:53:34 -0000
@@ -2969,6 +2969,8 @@
 	fprintf_unfiltered (gdb_stdlog, "\n");
     }
 
+  regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+
   /* Return adjusted stack pointer.  */
   return sp;
 }
@@ -3198,6 +3200,8 @@
 	fprintf_unfiltered (gdb_stdlog, "\n");
     }
 
+  regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+
   /* Return adjusted stack pointer.  */
   return sp;
 }
@@ -3504,6 +3508,8 @@
 	fprintf_unfiltered (gdb_stdlog, "\n");
     }
 
+  regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+
   /* Return adjusted stack pointer.  */
   return sp;
 }
@@ -3810,6 +3816,8 @@
 	fprintf_unfiltered (gdb_stdlog, "\n");
     }
 
+  regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+
   /* Return adjusted stack pointer.  */
   return sp;
 }
@@ -5927,7 +5935,6 @@
   set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
   set_gdbarch_deprecated_target_read_fp (gdbarch, mips_read_sp); /* Draft FRAME base.  */
   set_gdbarch_read_sp (gdbarch, mips_read_sp);
-  set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
 
   /* Add/remove bits from an address.  The MIPS needs be careful to
      ensure that all 32 bit addresses are sign extended to 64 bits.  */

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