aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-07-13 13:14:54 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-07-13 13:14:54 +0000
commit4844f454ad5c60a19793ac8354a76122a9fcb0e0 (patch)
tree0f728c8bd9149004cca5d929bd7f36590b77f0a2 /gdb/mips-tdep.c
parent7830cb4f50d1ba2edfb90b4bcbb34e7d32e38bef (diff)
downloadgdb-4844f454ad5c60a19793ac8354a76122a9fcb0e0.zip
gdb-4844f454ad5c60a19793ac8354a76122a9fcb0e0.tar.gz
gdb-4844f454ad5c60a19793ac8354a76122a9fcb0e0.tar.bz2
* mips-tdep.c (mips_integer_to_address): Simplify be calling
extract_signed_integer directly. Fix comment.
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index e0315df..0a63e4f 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -4647,19 +4647,14 @@ mips_register_sim_regno (int regnum)
}
-/* Convert an integer into an address. By first converting the value
- into a pointer and then extracting it signed, the address is
- guarenteed to be correctly sign extended. */
+/* Convert an integer into an address. Extracting the value signed
+ guarantees a correctly sign extended address. */
static CORE_ADDR
mips_integer_to_address (struct gdbarch *gdbarch,
struct type *type, const gdb_byte *buf)
{
- gdb_byte *tmp = alloca (TYPE_LENGTH (builtin_type_void_data_ptr));
- LONGEST val = unpack_long (type, buf);
- store_signed_integer (tmp, TYPE_LENGTH (builtin_type_void_data_ptr), val);
- return extract_signed_integer (tmp,
- TYPE_LENGTH (builtin_type_void_data_ptr));
+ return (CORE_ADDR) extract_signed_integer (buf, TYPE_LENGTH (type));
}
static void