From 22540ece94de28c19999f66a648be0781889cdda Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 8 May 2003 20:38:07 +0000 Subject: [PATCH] 2003-05-08 Andrew Cagney * 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. --- gdb/ChangeLog | 11 +++++++++++ gdb/mips-tdep.c | 30 ++++++++++++++++++++++++++++++ gdb/regcache.c | 30 ------------------------------ gdb/regcache.h | 4 ---- 4 files changed, 41 insertions(+), 34 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f0d19c4226d..67c8ed706f9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2003-05-08 Andrew Cagney + + * 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. + 2003-05-08 Andrew Cagney * gdbarch.sh: Add comments on MAX_REGISTER_SIZE. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 61f6c6c5544..619021ba3f8 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) diff --git a/gdb/regcache.c b/gdb/regcache.c index 5fa2b4a8b32..8e2a4a94e9b 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -1208,36 +1208,6 @@ read_register_pid (int regnum, ptid_t ptid) return retval; } -/* Return the contents of register REGNUM as a signed integer. */ - -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))); -} - -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; -} - /* Store VALUE into the raw contents of register number REGNUM. */ void diff --git a/gdb/regcache.h b/gdb/regcache.h index 3fb43c437a4..2368cf0ff43 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -247,10 +247,6 @@ extern ULONGEST read_register (int regnum); /* Rename to read_unsigned_register_pid()? */ extern ULONGEST read_register_pid (int regnum, ptid_t ptid); -extern LONGEST read_signed_register (int regnum); - -extern LONGEST read_signed_register_pid (int regnum, ptid_t ptid); - extern void write_register (int regnum, LONGEST val); extern void write_register_pid (int regnum, CORE_ADDR val, ptid_t ptid); -- 2.30.2