From: Andreas Schwab <schwab@suse.de>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Updates for m68k-linux target
Date: Wed, 30 Jan 2002 05:57:00 -0000 [thread overview]
Message-ID: <je8zaggcvf.fsf@sykes.suse.de> (raw)
In-Reply-To: <3C5716E7.2010209@cygnus.com> (Andrew Cagney's message of "Tue, 29 Jan 2002 16:40:55 -0500")
Andrew Cagney <ac131313@cygnus.com> writes:
|> > + for (i = FPC_REGNUM; i <= FPI_REGNUM; i++)
|> > + if (regno == -1 || regno == i)
|> > + fpregsetp->fpcntl[regno - FPC_REGNUM]
|> > + = *(int *) ®isters[REGISTER_BYTE (regno)];
|> >
|> BTW, there were a few registers[] references still lurking in there.
Thanks for noticing, I have fixed it and installed the patch below for being
obvious.
Andreas.
2002-01-30 Andreas Schwab <schwab@suse.de>
* m68klinux-nat.c: Fix last change to use regcache_collect
instead of referencing registers[] directly.
Index: m68klinux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/m68klinux-nat.c,v
retrieving revision 1.7
diff -u -a -r1.7 m68klinux-nat.c
--- m68klinux-nat.c 2002/01/26 22:23:22 1.7
+++ m68klinux-nat.c 2002/01/30 13:55:22
@@ -195,6 +195,7 @@
register int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
+ char *buf = alloca (MAX_REGISTER_RAW_SIZE);
if (CANNOT_STORE_REGISTER (regno))
{
@@ -208,11 +209,16 @@
offset = U_REGS_OFFSET;
regaddr = register_addr (regno, offset);
+
+ /* Put the contents of regno into a local buffer */
+ regcache_collect (regno, buf);
+
+ /* Store the local buffer into the inferior a chunk at the time. */
for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
- *(PTRACE_XFER_TYPE *) & registers[REGISTER_BYTE (regno) + i]);
+ *(PTRACE_XFER_TYPE *) (buf + i));
regaddr += sizeof (PTRACE_XFER_TYPE);
if (errno != 0)
{
@@ -370,15 +376,12 @@
/* Fill in the floating-point registers. */
for (i = FP0_REGNUM; i < FP0_REGNUM + 8; i++)
if (regno == -1 || regno == i)
- memcpy (FPREG_ADDR (fpregsetp, regno - FP0_REGNUM),
- ®isters[REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE(regno));
+ regcache_collect (regno, FPREG_ADDR (fpregsetp, regno - FP0_REGNUM));
/* Fill in the floating-point control registers. */
for (i = FPC_REGNUM; i <= FPI_REGNUM; i++)
if (regno == -1 || regno == i)
- fpregsetp->fpcntl[regno - FPC_REGNUM]
- = *(int *) ®isters[REGISTER_BYTE (regno)];
+ regcache_collect (regno, fpregsetp->fpcntl[regno - FPC_REGNUM]);
}
#ifdef HAVE_PTRACE_GETREGS
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
prev parent reply other threads:[~2002-01-30 13:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-24 2:02 Andreas Schwab
2002-01-24 9:52 ` Andrew Cagney
2002-01-26 14:24 ` Andreas Schwab
2002-01-29 13:41 ` Andrew Cagney
2002-01-30 5:57 ` Andreas Schwab [this message]
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=je8zaggcvf.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=ac131313@cygnus.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