aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-05-08 20:38:07 +0000
committerAndrew Cagney <cagney@redhat.com>2003-05-08 20:38:07 +0000
commit22540ece94de28c19999f66a648be0781889cdda (patch)
tree6d30a56a7570fd074f57cac72c87d785ca3c4953 /gdb/mips-tdep.c
parentbf1e742e90146a4a4defde6e8790c8ce6cbe5a45 (diff)
downloadgdb-22540ece94de28c19999f66a648be0781889cdda.zip
gdb-22540ece94de28c19999f66a648be0781889cdda.tar.gz
gdb-22540ece94de28c19999f66a648be0781889cdda.tar.bz2
2003-05-08 Andrew Cagney <cagney@redhat.com>
* mips-tdep.c (read_signed_register): New function, moved to here from "regcache.c". (read_signed_register_pid): Ditto. * regcache.c (read_signed_register_pid): Delete function, moved to "mips-tdep.c". (read_signed_register): Ditto. * regcache.h (read_signed_register): Delete declaration. (read_signed_register_pid): Delete declaration.
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 61f6c6c..619021b 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -150,6 +150,36 @@ static const char *mips_saved_regsize_string = size_auto;
#define MIPS_SAVED_REGSIZE (mips_saved_regsize())
+/* Return the contents of register REGNUM as a signed integer. */
+
+static LONGEST
+read_signed_register (int regnum)
+{
+ void *buf = alloca (REGISTER_RAW_SIZE (regnum));
+ deprecated_read_register_gen (regnum, buf);
+ return (extract_signed_integer (buf, REGISTER_RAW_SIZE (regnum)));
+}
+
+static LONGEST
+read_signed_register_pid (int regnum, ptid_t ptid)
+{
+ ptid_t save_ptid;
+ LONGEST retval;
+
+ if (ptid_equal (ptid, inferior_ptid))
+ return read_signed_register (regnum);
+
+ save_ptid = inferior_ptid;
+
+ inferior_ptid = ptid;
+
+ retval = read_signed_register (regnum);
+
+ inferior_ptid = save_ptid;
+
+ return retval;
+}
+
/* Return the MIPS ABI associated with GDBARCH. */
enum mips_abi
mips_abi (struct gdbarch *gdbarch)