Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa:rs6000] Move rs6000_fix_call_dummy into push_dummy_call
Date: Tue, 09 Sep 2003 21:48:00 -0000	[thread overview]
Message-ID: <3F5E4A9D.7080500@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Hello,

This isn't so obvious.

The rs6000 was unconditionally setting the FIX_CALL_DUMMY method and 
then using it as a way of setting the TOC register.  #include "the thing 
is" ...

The function looks like:

   if (rs6000_find_toc_address_hook != NULL)
     {
       CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (fun);
       write_register (gdbarch_tdep (current_gdbarch)->ppc_toc_regnum,
                       tocvalue);
     }

but "rs6000_find_toc_address_hook" is only non NULL when the GDB build 
includes "rs6000-nat.c" which is AIX specific.

Hence, since this is an AIX / RS6000 / PowerOpen specific thing (and not 
PPC SysV), I'm only moving it to rs6000_push_dummy_call.

make sense?  ok?
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2000 bytes --]

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

	* rs6000-tdep.c (rs6000_fix_call_dummy): Delete function.
	(rs6000_push_dummy_call): Set the "TOC" register.

Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.152
diff -u -r1.152 rs6000-tdep.c
--- rs6000-tdep.c	9 Sep 2003 20:22:37 -0000	1.152
+++ rs6000-tdep.c	9 Sep 2003 21:45:46 -0000
@@ -1075,25 +1075,6 @@
   flush_cached_frames ();
 }
 
-/* Fixup the call sequence of a dummy function, with the real function
-   address.  Its arguments will be passed by gdb.  */
-
-static void
-rs6000_fix_call_dummy (char *dummyname, CORE_ADDR pc, CORE_ADDR fun,
-		       int nargs, struct value **args, struct type *type,
-		       int gcc_p)
-{
-  int ii;
-  CORE_ADDR target_addr;
-
-  if (rs6000_find_toc_address_hook != NULL)
-    {
-      CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (fun);
-      write_register (gdbarch_tdep (current_gdbarch)->ppc_toc_regnum,
-		      tocvalue);
-    }
-}
-
 /* All the ABI's require 16 byte alignment.  */
 static CORE_ADDR
 rs6000_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
@@ -1321,6 +1302,14 @@
   store_unsigned_integer (tmp_buffer, 4, saved_sp);
   write_memory (sp, tmp_buffer, 4);
 
+  /* 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)
+    {
+      CORE_ADDR tocvalue = (*rs6000_find_toc_address_hook) (func_addr);
+      regcache_raw_write_signed (regcache, tdep->ppc_toc_regnum, tocvalue);
+    }
+
   target_store_registers (-1);
   return sp;
 }
@@ -2941,7 +2930,6 @@
     set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
   set_gdbarch_char_signed (gdbarch, 0);
 
-  set_gdbarch_deprecated_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
   set_gdbarch_frame_align (gdbarch, rs6000_frame_align);
   if (sysv_abi && wordsize == 8)
     /* PPC64 SYSV.  */

             reply	other threads:[~2003-09-09 21:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-09 21:48 Andrew Cagney [this message]
2003-09-09 21:58 ` Kevin Buettner
2003-09-09 22:22   ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F5E4A9D.7080500@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox