aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-08-13 14:32:28 +0000
committerAndrew Cagney <cagney@redhat.com>2002-08-13 14:32:28 +0000
commit28fc67409494a8a33cb1a7826a896a054ca71dd3 (patch)
tree55b6296ba26a63f1c11e8d4d04e0131247553985 /gdb/regcache.c
parenta378f4192681bdbeb5f7aa12ae3c6e9505cd14a7 (diff)
downloadgdb-28fc67409494a8a33cb1a7826a896a054ca71dd3.zip
gdb-28fc67409494a8a33cb1a7826a896a054ca71dd3.tar.gz
gdb-28fc67409494a8a33cb1a7826a896a054ca71dd3.tar.bz2
2002-08-13 Andrew Cagney <cagney@redhat.com>
* i386-tdep.c (i386_register_name): Handle mmx registers. (mmx_regnum_p): New function. (i386_mmx_names): New array. (mmx_num_regs): New variable. (i386_pseudo_register_read): New function. (i386_pseudo_register_write): New function. (mmx_regnum_to_fp_regnum): New function. Code from Fernando Nasser. * regcache.c (regcache_raw_read_unsigned): New function. (regcache_raw_read_signed): New function. * regcache.h (regcache_raw_read_unsigned): Declare. (regcache_raw_read_signed): Declare.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 6878b52..85d96c9 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -661,6 +661,31 @@ regcache_raw_read (struct regcache *regcache, int regnum, void *buf)
}
void
+regcache_raw_read_signed (struct regcache *regcache, int regnum, LONGEST *val)
+{
+ char *buf;
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ buf = alloca (regcache->descr->sizeof_register[regnum]);
+ regcache_raw_read (regcache, regnum, buf);
+ (*val) = extract_signed_integer (buf,
+ regcache->descr->sizeof_register[regnum]);
+}
+
+void
+regcache_raw_read_unsigned (struct regcache *regcache, int regnum,
+ ULONGEST *val)
+{
+ char *buf;
+ gdb_assert (regcache != NULL);
+ gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+ buf = alloca (regcache->descr->sizeof_register[regnum]);
+ regcache_raw_read (regcache, regnum, buf);
+ (*val) = extract_unsigned_integer (buf,
+ regcache->descr->sizeof_register[regnum]);
+}
+
+void
read_register_gen (int regnum, char *buf)
{
gdb_assert (current_regcache != NULL);