From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA/RFC/IRIX] remove last uses of deprecated_registers in irix5-nat
Date: Sat, 13 Nov 2004 23:27:00 -0000 [thread overview]
Message-ID: <20041113232716.GA32567@gnat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 559 bytes --]
This patch deals with the last 2 instances of deprecated_registers
found in irix5-nat.c:
2004-11-13 Joel Brobecker <brobecker@gnat.com>
* irix5-nat.c (fetch_core_registers): Replace use of
deprecated_registers by equivalent code.
Tested on mips-irix using corefile.exp. No regression.
Given that Andrew gave me a green light for the previous patch
(http://sources.redhat.com/ml/gdb-patches/2004-11/msg00292.html)
and followup patches, I will commit this change. But don't hesitate
to send tomatoes I me if I botched something.
--
Joel
[-- Attachment #2: core-irix.diff --]
[-- Type: text/plain, Size: 2253 bytes --]
--- irix5-nat.c.orig 2004-11-13 17:31:39.631455281 -0500
+++ irix5-nat.c 2004-11-13 18:17:08.214095369 -0500
@@ -221,52 +221,33 @@ static void
fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
+ char *srcp = core_reg_sect;
+ int regno;
+
if (core_reg_size == deprecated_register_bytes ())
{
- memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size);
+ for (regno = 0; regno < NUM_REGS; regno++)
+ {
+ regcache_raw_write (current_regcache, regno, srcp);
+ srcp += register_size (current_gdbarch, regno);
+ }
}
else if (mips_isa_regsize (current_gdbarch) == 4 &&
core_reg_size == (2 * mips_isa_regsize (current_gdbarch)) * NUM_REGS)
{
/* This is a core file from a N32 executable, 64 bits are saved
for all registers. */
- char *srcp = core_reg_sect;
- char *dstp = deprecated_registers;
- int regno;
-
for (regno = 0; regno < NUM_REGS; regno++)
{
if (regno >= FP0_REGNUM && regno < (FP0_REGNUM + 32))
{
- /* FIXME, this is wrong, N32 has 64 bit FP regs, but GDB
- currently assumes that they are 32 bit. */
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
- if (register_size (current_gdbarch, regno) == 4)
- {
- /* copying 4 bytes from eight bytes?
- I don't see how this can be right... */
- srcp += 4;
- }
- else
- {
- /* copy all 8 bytes (sizeof(double)) */
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
- }
+ regcache_raw_write (current_regcache, regno, srcp);
}
else
{
- srcp += 4;
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
- *dstp++ = *srcp++;
+ regcache_raw_write (current_regcache, regno, srcp + 4);
}
+ srcp += 8;
}
}
else
@@ -274,8 +255,6 @@ fetch_core_registers (char *core_reg_sec
warning ("wrong size gregset struct in core file");
return;
}
-
- deprecated_registers_fetched ();
}
/* Register that we are able to handle irix5 core file formats.
next reply other threads:[~2004-11-13 23:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-13 23:27 Joel Brobecker [this message]
2004-11-14 1:10 ` 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=20041113232716.GA32567@gnat.com \
--to=brobecker@gnat.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