From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] [17/17] Get rid of current_gdbarch in go32-nat.c
Date: Thu, 11 Oct 2007 08:56:00 -0000 [thread overview]
Message-ID: <470DE4C1.9070509@de.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
Hi,
this patch gets rid of some of the current_gdbarch's in go32-nat.c
Is this ok to commit?
ChangeLog:
* go32-nat.c (fetch_register, go32_fetch_registers, store_register)
(go32_store_registers): Use get_regcache_arch to get at the current
architecture by regcache.
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
[-- Attachment #2: diff-go32 --]
[-- Type: text/plain, Size: 1733 bytes --]
diff -urpN src/gdb/go32-nat.c dev/gdb/go32-nat.c
--- src/gdb/go32-nat.c 2007-08-23 20:08:33.000000000 +0200
+++ dev/gdb/go32-nat.c 2007-10-11 10:36:08.000000000 +0200
@@ -465,7 +465,7 @@ go32_wait (ptid_t ptid, struct target_wa
static void
fetch_register (struct regcache *regcache, int regno)
{
- if (regno < gdbarch_fp0_regnum (current_gdbarch))
+ if (regno < gdbarch_fp0_regnum (get_regcache_arch (regcache)))
regcache_raw_supply (regcache, regno,
(char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
@@ -482,7 +482,8 @@ go32_fetch_registers (struct regcache *r
fetch_register (regcache, regno);
else
{
- for (regno = 0; regno < gdbarch_fp0_regnum (current_gdbarch); regno++)
+ for (regno = 0;
+ regno < gdbarch_fp0_regnum (get_regcache_arch (regcache)); regno++)
fetch_register (regcache, regno);
i387_supply_fsave (regcache, -1, &npx);
}
@@ -491,7 +492,7 @@ go32_fetch_registers (struct regcache *r
static void
store_register (const struct regcache *regcache, int regno)
{
- if (regno < gdbarch_fp0_regnum (current_gdbarch))
+ if (regno < gdbarch_fp0_regnum (get_regcache_arch (regcache)))
regcache_raw_collect (regcache, regno,
(char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno))
@@ -510,7 +511,7 @@ go32_store_registers (struct regcache *r
store_register (regcache, regno);
else
{
- for (r = 0; r < gdbarch_fp0_regnum (current_gdbarch); r++)
+ for (r = 0; r < gdbarch_fp0_regnum (get_regcache_arch (regcache)); r++)
store_register (regcache, r);
i387_collect_fsave (regcache, -1, &npx);
}
next reply other threads:[~2007-10-11 8:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-11 8:56 Markus Deuling [this message]
2007-10-12 10:56 ` Eli Zaretskii
2007-10-22 7:44 ` Markus Deuling
2007-10-22 20:25 ` Eli Zaretskii
2007-10-23 10:31 ` Markus Deuling
2007-10-23 21:15 ` Eli Zaretskii
2007-10-23 21:55 ` Daniel Jacobowitz
2007-10-24 4:08 ` Eli Zaretskii
2007-10-24 11:48 ` Daniel Jacobowitz
2007-10-24 19:24 ` Eli Zaretskii
2007-10-24 13:39 ` Ulrich Weigand
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=470DE4C1.9070509@de.ibm.com \
--to=deuling@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.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