* mips-tdep.c (mips_integer_to_address): Simplify be calling
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 13 Jul 2006 13:14:54 +0000 (13:14 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 13 Jul 2006 13:14:54 +0000 (13:14 +0000)
extract_signed_integer directly.  Fix comment.

gdb/ChangeLog
gdb/mips-tdep.c

index c4e6613..35c7b84 100644 (file)
@@ -1,5 +1,10 @@
 2006-07-13  Corinna Vinschen  <vinschen@redhat.com>
 
+       * mips-tdep.c (mips_integer_to_address): Simplify be calling
+       extract_signed_integer directly.  Fix comment.
+
+2006-07-13  Corinna Vinschen  <vinschen@redhat.com>
+
        * m32c-tdep.c (m32c_banked_register): New function.
        (m32c_banked_read): Use m32c_banked_register function to evaluate
        real register number.
index e0315df..0a63e4f 100644 (file)
@@ -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