aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2004-10-13 16:38:22 +0000
committerKevin Buettner <kevinb@redhat.com>2004-10-13 16:38:22 +0000
commit9f3359456878efddffc9c96c2107ee7f3ef2436b (patch)
tree36972480f6f00954c837e4dda28c9e871ae1b81c /gdb
parentfb5b547845302fe64f118f9bc5eb0ef636cfafb7 (diff)
downloadgdb-9f3359456878efddffc9c96c2107ee7f3ef2436b.zip
gdb-9f3359456878efddffc9c96c2107ee7f3ef2436b.tar.gz
gdb-9f3359456878efddffc9c96c2107ee7f3ef2436b.tar.bz2
* rs6000-tdep.c (rs6000_push_dummy_call): Replace references to
``deprecated_registers'' with equivalent code. Use gdb_assert() instead of explicit test and print statement.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/rs6000-tdep.c42
2 files changed, 26 insertions, 22 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a4a8fd3..e175900 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-13 Kevin Buettner <kevinb@redhat.com>
+
+ * rs6000-tdep.c (rs6000_push_dummy_call): Replace references to
+ ``deprecated_registers'' with equivalent code. Use gdb_assert()
+ instead of explicit test and print statement.
+
2004-10-12 Mark Kettenis <kettenis@gnu.org>
* sparc-nat.c: Include "inf-ptrace.h".
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 36741c5..37988a3 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1478,14 +1478,11 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
There are 13 fpr's reserved for passing parameters. At this point
there is no way we would run out of them. */
- if (len > 8)
- printf_unfiltered ("Fatal Error: a floating point parameter "
- "#%d with a size > 8 is found!\n", argno);
-
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE
- (tdep->ppc_fp0_regnum + 1 + f_argno)],
- VALUE_CONTENTS (arg),
- len);
+ gdb_assert (len <= 8);
+
+ regcache_cooked_write (regcache,
+ tdep->ppc_fp0_regnum + 1 + f_argno,
+ VALUE_CONTENTS (arg));
++f_argno;
}
@@ -1495,12 +1492,15 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Argument takes more than one register. */
while (argbytes < len)
{
- memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0,
- reg_size);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)],
+ char word[MAX_REGISTER_SIZE];
+ memset (word, 0, reg_size);
+ memcpy (word,
((char *) VALUE_CONTENTS (arg)) + argbytes,
(len - argbytes) > reg_size
? reg_size : len - argbytes);
+ regcache_cooked_write (regcache,
+ tdep->ppc_gp0_regnum + 3 + ii,
+ word);
++ii, argbytes += reg_size;
if (ii >= 8)
@@ -1513,9 +1513,11 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
/* Argument can fit in one register. No problem. */
int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
- memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)], 0, reg_size);
- memcpy ((char *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (ii + 3)] + adj,
- VALUE_CONTENTS (arg), len);
+ char word[MAX_REGISTER_SIZE];
+
+ memset (word, 0, reg_size);
+ memcpy (word, VALUE_CONTENTS (arg), len);
+ regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word);
}
++argno;
}
@@ -1592,15 +1594,11 @@ ran_out_of_registers_for_arguments:
if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13)
{
- if (len > 8)
- printf_unfiltered ("Fatal Error: a floating point parameter"
- " #%d with a size > 8 is found!\n", argno);
+ gdb_assert (len <= 8);
- memcpy (&(deprecated_registers
- [DEPRECATED_REGISTER_BYTE
- (tdep->ppc_fp0_regnum + 1 + f_argno)]),
- VALUE_CONTENTS (arg),
- len);
+ regcache_cooked_write (regcache,
+ tdep->ppc_fp0_regnum + 1 + f_argno,
+ VALUE_CONTENTS (arg));
++f_argno;
}