From c00dcbe9654f01e87fe34825299296147a4646d7 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 25 Aug 2002 23:44:30 +0000 Subject: [PATCH] * regcache.c (regcache_raw_write_signed, regcache_raw_write_unsigned): New functions. * regcache.h (regcache_raw_write_signed, regcache_raw_write_unsigned): New prototypes. --- gdb/ChangeLog | 7 +++++++ gdb/regcache.c | 23 +++++++++++++++++++++++ gdb/regcache.h | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a98c10a8e14..078aff312e0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2002-08-26 Mark Kettenis + + * 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 * Makefile.in (c-exp.tab.o, jv-exp.tab.o, f-exp.tab.o) diff --git a/gdb/regcache.c b/gdb/regcache.c index 6c86ba98c98..ab65c67a47b 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -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) { diff --git a/gdb/regcache.h b/gdb/regcache.h index 1db42e3d7de..4ddcda38104 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -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. */ -- 2.30.2