This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Reimplement supply_register and regcache_collect
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 29 Aug 2003 13:48:12 +0200 (CEST)
- Subject: [PATCH] Reimplement supply_register and regcache_collect
As per Andrews request.
Checked in.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* regcache.c (supply_register): Reimplement to call
regcache_raw_supply.
(regcache_collect): Reimplement by calling regcache_raw_collect.
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.95
diff -u -p -r1.95 regcache.c
--- regcache.c 29 Aug 2003 09:59:28 -0000 1.95
+++ regcache.c 29 Aug 2003 11:46:26 -0000
@@ -1218,21 +1218,7 @@ write_register_pid (int regnum, CORE_ADD
void
supply_register (int regnum, const void *val)
{
-#if 1
- if (! ptid_equal (registers_ptid, inferior_ptid))
- {
- registers_changed ();
- registers_ptid = inferior_ptid;
- }
-#endif
-
- set_register_cached (regnum, 1);
- if (val)
- memcpy (register_buffer (current_regcache, regnum), val,
- REGISTER_RAW_SIZE (regnum));
- else
- memset (register_buffer (current_regcache, regnum), '\000',
- REGISTER_RAW_SIZE (regnum));
+ regcache_raw_supply (current_regcache, regnum, val);
/* On some architectures, e.g. HPPA, there are a few stray bits in
some registers, that the rest of the code would like to ignore. */
@@ -1252,8 +1238,7 @@ supply_register (int regnum, const void
void
regcache_collect (int regnum, void *buf)
{
- memcpy (buf, register_buffer (current_regcache, regnum),
- REGISTER_RAW_SIZE (regnum));
+ regcache_raw_collect (current_regcache, regnum, buf);
}
/* Supply register REGNUM, whose contents are store in BUF, to REGCACHE. */