aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-08-13 13:58:50 +0000
committerAndrew Cagney <cagney@redhat.com>2002-08-13 13:58:50 +0000
commita378f4192681bdbeb5f7aa12ae3c6e9505cd14a7 (patch)
treec9e865f6a70dd3c4c0e479debd2854f80ae9f251 /gdb/regcache.c
parent212a3c4d9dc124caf97fda76260c67f0ea467cdd (diff)
downloadgdb-a378f4192681bdbeb5f7aa12ae3c6e9505cd14a7.zip
gdb-a378f4192681bdbeb5f7aa12ae3c6e9505cd14a7.tar.gz
gdb-a378f4192681bdbeb5f7aa12ae3c6e9505cd14a7.tar.bz2
2002-08-12 Andrew Cagney <cagney@redhat.com>
* regcache.c (regcache_raw_read_as_address): Delete function. (regcache_cooked_read_signed): New function. (regcache_cooked_read_unsigned): New function. * regcache.h (regcache_cooked_read_signed): Declare. (regcache_cooked_read_unsigned): Declare. (regcache_raw_read_as_address): Delete declaration. * blockframe.c (generic_read_register_dummy): Use regcache_cooked_read_unsigned. * i386-tdep.c (i386_extract_struct_value_address): Use regcache_cooked_read_unsigned.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index c633d2d..6878b52 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -366,17 +366,6 @@ regcache_valid_p (struct regcache *regcache, int regnum)
return regcache->raw_register_valid_p[regnum];
}
-CORE_ADDR
-regcache_raw_read_as_address (struct regcache *regcache, int regnum)
-{
- 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);
- return extract_address (buf, regcache->descr->sizeof_register[regnum]);
-}
-
char *
deprecated_grub_regcache_for_registers (struct regcache *regcache)
{
@@ -696,6 +685,32 @@ regcache_cooked_read (struct regcache *regcache, int regnum, void *buf)
regnum, buf);
}
+void
+regcache_cooked_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_cooked_read (regcache, regnum, buf);
+ (*val) = extract_signed_integer (buf,
+ regcache->descr->sizeof_register[regnum]);
+}
+
+void
+regcache_cooked_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_cooked_read (regcache, regnum, buf);
+ (*val) = extract_unsigned_integer (buf,
+ regcache->descr->sizeof_register[regnum]);
+}
+
/* Write register REGNUM at MYADDR to the target. MYADDR points at
REGISTER_RAW_BYTES(REGNUM), which must be in target byte-order. */