From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: rs6000: remove some uses of DEPRECATED_REGISTER_BYTE
Date: Fri, 21 May 2004 00:29:00 -0000 [thread overview]
Message-ID: <vt23c5uy6cs.fsf@zenia.home> (raw)
2004-05-20 Jim Blandy <jimb@redhat.com>
* rs6000-tdep.c (rs6000_push_dummy_call): Remove uses of
DEPRECATED_REGISTER_BYTE and deprecated_registers.
Index: gdb/rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.207
diff -c -p -r1.207 rs6000-tdep.c
*** gdb/rs6000-tdep.c 20 May 2004 18:49:37 -0000 1.207
--- gdb/rs6000-tdep.c 20 May 2004 19:31:08 -0000
*************** rs6000_push_dummy_call (struct gdbarch *
*** 1305,1315 ****
--- 1305,1318 ----
for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii)
{
int reg_size = DEPRECATED_REGISTER_RAW_SIZE (ii + 3);
+ unsigned char buf[MAX_REGISTER_SIZE];
arg = args[argno];
type = check_typedef (VALUE_TYPE (arg));
len = TYPE_LENGTH (type);
+ memset (buf, 0, sizeof (buf));
+
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
*************** rs6000_push_dummy_call (struct gdbarch *
*** 1321,1330 ****
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);
++f_argno;
}
--- 1324,1333 ----
printf_unfiltered ("Fatal Error: a floating point parameter "
"#%d with a size > 8 is found!\n", argno);
! memcpy (buf, VALUE_CONTENTS (arg), len);
! regcache_cooked_write (regcache,
! tdep->ppc_fp0_regnum + 1 + f_argno,
! buf);
++f_argno;
}
*************** rs6000_push_dummy_call (struct gdbarch *
*** 1334,1345 ****
/* 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 *) VALUE_CONTENTS (arg)) + argbytes,
! (len - argbytes) > reg_size
! ? reg_size : len - argbytes);
++ii, argbytes += reg_size;
if (ii >= 8)
--- 1337,1346 ----
/* Argument takes more than one register. */
while (argbytes < len)
{
! memcpy (buf,
! ((char *) VALUE_CONTENTS (arg)) + argbytes,
! min (len - argbytes, reg_size));
! regcache_cooked_write (regcache, ii + 3, buf);
++ii, argbytes += reg_size;
if (ii >= 8)
*************** rs6000_push_dummy_call (struct gdbarch *
*** 1352,1360 ****
{
/* 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);
}
++argno;
}
--- 1353,1360 ----
{
/* Argument can fit in one register. No problem. */
int adj = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? reg_size - len : 0;
! memcpy (buf + adj, VALUE_CONTENTS (arg), len);
! regcache_cooked_write (regcache, ii + 3, buf);
}
++argno;
}
*************** ran_out_of_registers_for_arguments:
*** 1420,1445 ****
/* Push the rest of the arguments into stack. */
for (; argno < nargs; ++argno)
{
-
arg = args[argno];
type = check_typedef (VALUE_TYPE (arg));
len = TYPE_LENGTH (type);
-
/* Float types should be passed in fpr's, as well as in the
stack. */
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);
! memcpy (&(deprecated_registers
! [DEPRECATED_REGISTER_BYTE
! (tdep->ppc_fp0_regnum + 1 + f_argno)]),
! VALUE_CONTENTS (arg),
! len);
++f_argno;
}
--- 1420,1444 ----
/* Push the rest of the arguments into stack. */
for (; argno < nargs; ++argno)
{
arg = args[argno];
type = check_typedef (VALUE_TYPE (arg));
len = TYPE_LENGTH (type);
/* Float types should be passed in fpr's, as well as in the
stack. */
if (TYPE_CODE (type) == TYPE_CODE_FLT && f_argno < 13)
{
+ unsigned char buf[MAX_REGISTER_SIZE];
if (len > 8)
printf_unfiltered ("Fatal Error: a floating point parameter"
" #%d with a size > 8 is found!\n", argno);
! memset (buf, 0, sizeof (buf));
! memcpy (buf, VALUE_CONTENTS (arg), len);
! regcache_cooked_write (regcache,
! tdep->ppc_fp0_regnum + 1 + f_argno,
! buf);
++f_argno;
}
next reply other threads:[~2004-05-21 0:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-21 0:29 Jim Blandy [this message]
2004-05-21 20:16 ` Kevin Buettner
2004-05-21 22:09 ` Jim Blandy
2004-06-01 22:39 ` Kevin Buettner
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=vt23c5uy6cs.fsf@zenia.home \
--to=jimb@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