2003-09-11 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Thu, 11 Sep 2003 19:27:25 +0000 (19:27 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 11 Sep 2003 19:27:25 +0000 (19:27 +0000)
* rs6000-tdep.c (rs6000_push_dummy_call): Use
regcache_raw_write_signed to set SP_REGNUM, move the operation to
near the function's end.
(rs6000_gdbarch_init): Do not set "deprecated_dummy_write_sp".
* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Use
regcache_raw_write_signed to set SP_REGNUM.

gdb/ChangeLog
gdb/ppc-sysv-tdep.c
gdb/rs6000-tdep.c

index 56898d19b99b6aa65d77636513adf1ea6f02946d..642ec3a67cb362b2b6a7c4361c1ffbe58a4fc997 100644 (file)
@@ -1,3 +1,12 @@
+2003-09-11  Andrew Cagney  <cagney@redhat.com>
+
+       * rs6000-tdep.c (rs6000_push_dummy_call): Use
+       regcache_raw_write_signed to set SP_REGNUM, move the operation to
+       near the function's end.
+       (rs6000_gdbarch_init): Do not set "deprecated_dummy_write_sp".
+       * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Use
+       regcache_raw_write_signed to set SP_REGNUM.
+
 2003-09-11  Elena Zannoni  <ezannoni@redhat.com>
 
        * symfile.c (symbol_file_add_with_addrs_or_offsets): Make sure
index 954800770efdfb11fe9d5803536782639e2493ca..2f13e2981c621191e60f98707d98660b8e6eb4d8 100644 (file)
@@ -189,8 +189,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
   /* Make sure that we maintain 16 byte alignment */
   sp &= ~0x0f;
 
-  /* Update %sp before proceeding any further */
-  write_register (SP_REGNUM, sp);
+  /* Update %sp before proceeding any further.   */
+  regcache_raw_write_signed (regcache, SP_REGNUM, sp);
 
   /* write the backchain */
   store_unsigned_integer (old_sp_buf, 4, saved_sp);
index abed029e072689c4df44f9dd323916911d82be38..6d348db84806ef4eb13d2f6d6c32118a572f89e5 100644 (file)
@@ -1246,14 +1246,6 @@ ran_out_of_registers_for_arguments:
       space = (space + 15) & -16;
       sp -= space;
 
-      /* This is another instance we need to be concerned about
-         securing our stack space. If we write anything underneath %sp
-         (r1), we might conflict with the kernel who thinks he is free
-         to use this area. So, update %sp first before doing anything
-         else.  */
-
-      write_register (SP_REGNUM, sp);
-
       /* If the last argument copied into the registers didn't fit there 
          completely, push the rest of it into stack.  */
 
@@ -1294,14 +1286,17 @@ ran_out_of_registers_for_arguments:
          ii += ((len + 3) & -4) / 4;
        }
     }
-  else
-    /* Secure stack areas first, before doing anything else.  */
-    write_register (SP_REGNUM, sp);
 
   /* set back chain properly */
   store_unsigned_integer (tmp_buffer, 4, saved_sp);
   write_memory (sp, tmp_buffer, 4);
 
+  /* Set the stack pointer.  According to the ABI, the SP is ment to
+     be set _before_ the corresponding stack space is used.  No need
+     for that here though - the target has been completly stopped - it
+     isn't possible for an exception handler to stomp on the stack.  */
+  regcache_raw_write_signed (regcache, SP_REGNUM, sp);
+
   /* Point the inferior function call's return address at the dummy's
      breakpoint.  */
   regcache_raw_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
@@ -2896,7 +2891,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     set_gdbarch_print_insn (gdbarch, gdb_print_insn_powerpc);
 
   set_gdbarch_write_pc (gdbarch, generic_target_write_pc);
-  set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
 
   set_gdbarch_num_regs (gdbarch, v->nregs);
   set_gdbarch_num_pseudo_regs (gdbarch, v->npregs);
This page took 0.031376 seconds and 4 git commands to generate.