* regcache.c (regcache_raw_write_signed,
authorMark Kettenis <kettenis@gnu.org>
Sun, 25 Aug 2002 23:44:30 +0000 (23:44 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 25 Aug 2002 23:44:30 +0000 (23:44 +0000)
regcache_raw_write_unsigned): New functions.
* regcache.h (regcache_raw_write_signed,
regcache_raw_write_unsigned): New prototypes.

gdb/ChangeLog
gdb/regcache.c
gdb/regcache.h

index a98c10a8e14278186f793ad10c265c445e00e635..078aff312e0dc6ffcffd4a7a0f96960c41915e49 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-26  Mark Kettenis  <kettenis@gnu.org>
+
+       * regcache.c (regcache_raw_write_signed,
+       regcache_raw_write_unsigned): New functions.
+       * regcache.h (regcache_raw_write_signed,
+       regcache_raw_write_unsigned): New prototypes.
+
 2002-08-25  Andrew Cagney  <ac131313@redhat.com>
 
        * Makefile.in (c-exp.tab.o, jv-exp.tab.o, f-exp.tab.o)
index 6c86ba98c989a0b6b2e26d0f9176f65c8d256224..ab65c67a47b7c1293bf9958bc9921537a5aab33e 100644 (file)
@@ -724,6 +724,29 @@ regcache_raw_read_unsigned (struct regcache *regcache, int regnum,
                                     regcache->descr->sizeof_register[regnum]);
 }
 
+void
+regcache_raw_write_signed (struct regcache *regcache, int regnum, LONGEST val)
+{
+  void *buf;
+  gdb_assert (regcache != NULL);
+  gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers);
+  buf = alloca (regcache->descr->sizeof_register[regnum]);
+  store_signed_integer (buf, regcache->descr->sizeof_register[regnum], val);
+  regcache_raw_write (regcache, regnum, buf);
+}
+
+void
+regcache_raw_write_unsigned (struct regcache *regcache, int regnum,
+                            ULONGEST val)
+{
+  void *buf;
+  gdb_assert (regcache != NULL);
+  gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers);
+  buf = alloca (regcache->descr->sizeof_register[regnum]);
+  store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum], val);
+  regcache_raw_write (regcache, regnum, buf);
+}
+
 void
 read_register_gen (int regnum, char *buf)
 {
index 1db42e3d7de2eadd985d8e080084c69da95b8f5b..4ddcda381048bd41bfb1614251e2bcb46cfb0888 100644 (file)
@@ -42,6 +42,10 @@ extern void regcache_raw_read_signed (struct regcache *regcache,
                                      int regnum, LONGEST *val);
 extern void regcache_raw_read_unsigned (struct regcache *regcache,
                                        int regnum, ULONGEST *val);
+extern void regcache_raw_write_signed (struct regcache *regcache,
+                                      int regnum, LONGEST val);
+extern void regcache_raw_write_unsigned (struct regcache *regcache,
+                                        int regnum, ULONGEST val);
 
 /* Partial transfer of a raw registers.  These perform read, modify,
    write style operations.  */