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]

[obish:ppc] Move push_return_address into push_dummy_call


Hello,

This moves the code setting the Link Register (in push_return_address) into the *_push_dummy_call methods.

The only querk here is that it sets the LR to the parameter BP_ADDR instead of entry_point_address() ("infcall.c" passes in entry_point_address() as the value of "bp_addr"). This lets "infcall.c" determine the actual location of the breakpoint - it can be put on the stack!

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

	* rs6000-tdep.c (ppc_push_return_address): Delete function.
	(rs6000_push_dummy_call): Set LR to BP_ADDR.
	(rs6000_gdbarch_init): Do not set deprecated_push_return_address.
	* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Ditto.

Index: ppc-sysv-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v
retrieving revision 1.7
diff -u -r1.7 ppc-sysv-tdep.c
--- ppc-sysv-tdep.c	9 Sep 2003 20:22:37 -0000	1.7
+++ ppc-sysv-tdep.c	9 Sep 2003 22:39:44 -0000
@@ -339,6 +339,10 @@
         }
     }
 
+  /* Point the inferior function call's return address at the dummy's
+     breakpoint.  */
+  regcache_raw_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
+
   target_store_registers (-1);
   return sp;
 }
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.154
diff -u -r1.154 rs6000-tdep.c
--- rs6000-tdep.c	9 Sep 2003 22:21:36 -0000	1.154
+++ rs6000-tdep.c	9 Sep 2003 22:39:49 -0000
@@ -1302,6 +1302,10 @@
   store_unsigned_integer (tmp_buffer, 4, saved_sp);
   write_memory (sp, tmp_buffer, 4);
 
+  /* Point the inferior function call's return address at the dummy's
+     breakpoint.  */
+  regcache_raw_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr);
+
   /* Set the TOC register, get the value from the objfile reader
      which, in turn, gets it from the VMAP table.  */
   if (rs6000_find_toc_address_hook != NULL)
@@ -1314,17 +1318,6 @@
   return sp;
 }
 
-/* Function: ppc_push_return_address (pc, sp)
-   Set up the return address for the inferior function call.  */
-
-static CORE_ADDR
-ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
-{
-  write_register (gdbarch_tdep (current_gdbarch)->ppc_lr_regnum,
-		  entry_point_address ());
-  return sp;
-}
-
 /* Extract a function return value of type TYPE from raw register array
    REGBUF, and copy that return value into VALBUF in virtual format.  */
 static void
@@ -2935,7 +2928,6 @@
     /* PowerOpen / AIX 32 bit.  */
     set_gdbarch_frame_red_zone_size (gdbarch, 220);
   set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
-  set_gdbarch_deprecated_push_return_address (gdbarch, ppc_push_return_address);
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
 
   set_gdbarch_deprecated_register_convertible (gdbarch, rs6000_register_convertible);

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