aboutsummaryrefslogtreecommitdiff
path: root/gdb/regcache.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2016-11-22 14:05:04 +0000
committerYao Qi <yao.qi@linaro.org>2016-11-22 14:05:04 +0000
commit9fd15b2e80452f03edb3fb36c2b4c36d05f4ef4e (patch)
tree0f06fc7acdfb4eeb563ac9554c42d0c6bee96711 /gdb/regcache.c
parent6884417a0ff3555b192d4aceeacc5e7232cad207 (diff)
downloadgdb-9fd15b2e80452f03edb3fb36c2b4c36d05f4ef4e.zip
gdb-9fd15b2e80452f03edb3fb36c2b4c36d05f4ef4e.tar.gz
gdb-9fd15b2e80452f03edb3fb36c2b4c36d05f4ef4e.tar.bz2
New regcache_raw_get_signed
This patch adds a new regcache api regcache_raw_get_signed. gdb: 2016-11-22 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache_raw_get_signed): New function. * regcache.h (regcache_raw_get_signed): Declare.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r--gdb/regcache.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c
index a5c90a6..1fcf933 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -742,6 +742,19 @@ regcache_raw_write_unsigned (struct regcache *regcache, int regnum,
regcache_raw_write (regcache, regnum, buf);
}
+LONGEST
+regcache_raw_get_signed (struct regcache *regcache, int regnum)
+{
+ LONGEST value;
+ enum register_status status;
+
+ status = regcache_raw_read_signed (regcache, regnum, &value);
+ if (status == REG_UNAVAILABLE)
+ throw_error (NOT_AVAILABLE_ERROR,
+ _("Register %d is not available"), regnum);
+ return value;
+}
+
enum register_status
regcache_cooked_read (struct regcache *regcache, int regnum, gdb_byte *buf)
{