From: Corinna Vinschen Date: Thu, 13 Jul 2006 13:14:54 +0000 (+0000) Subject: * mips-tdep.c (mips_integer_to_address): Simplify be calling X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4844f454ad5c60a19793ac8354a76122a9fcb0e0;p=binutils-gdb.git * mips-tdep.c (mips_integer_to_address): Simplify be calling extract_signed_integer directly. Fix comment. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c4e66135ed2..35c7b840396 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2006-07-13 Corinna Vinschen + + * mips-tdep.c (mips_integer_to_address): Simplify be calling + extract_signed_integer directly. Fix comment. + 2006-07-13 Corinna Vinschen * m32c-tdep.c (m32c_banked_register): New function. diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index e0315df2638..0a63e4f1566 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