diff options
author | Mark Kettenis <kettenis@gnu.org> | 2002-08-25 23:44:30 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2002-08-25 23:44:30 +0000 |
commit | c00dcbe9654f01e87fe34825299296147a4646d7 (patch) | |
tree | 682063ac2cb0321db907fe65e4a9b47375bd7bb5 /gdb/regcache.c | |
parent | 6ba6ffa237925a1f01fe70c33f3e2a0807e36e37 (diff) | |
download | gdb-c00dcbe9654f01e87fe34825299296147a4646d7.zip gdb-c00dcbe9654f01e87fe34825299296147a4646d7.tar.gz gdb-c00dcbe9654f01e87fe34825299296147a4646d7.tar.bz2 |
* regcache.c (regcache_raw_write_signed,
regcache_raw_write_unsigned): New functions.
* regcache.h (regcache_raw_write_signed,
regcache_raw_write_unsigned): New prototypes.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r-- | gdb/regcache.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c index 6c86ba9..ab65c67 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -725,6 +725,29 @@ regcache_raw_read_unsigned (struct regcache *regcache, int 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) { gdb_assert (current_regcache != NULL); |