* mips-tdep.c (mips_skip_pic_trampoline_code): Correct sign
authorMaciej W. Rozycki <macro@linux-mips.org>
Tue, 10 Apr 2012 23:06:57 +0000 (23:06 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Tue, 10 Apr 2012 23:06:57 +0000 (23:06 +0000)
extension in jump target calculation.

gdb/ChangeLog
gdb/mips-tdep.c

index 1312b1eb892b4a54e544598741c5d678ea7dd992..83dfa086a051e5a060f352ef9cf9b639f8fca059 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
+
+       * mips-tdep.c (mips_skip_pic_trampoline_code): Correct sign
+       extension in jump target calculation.
+
 2011-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * mips-tdep.c (mips32_next_pc): Handle JALX.
index 7ec358387b3131cbc25bc619d44375d1c96cae05..7b0ca703c891dcba9e0f6b6208c03585d51bf129 100644 (file)
@@ -5768,8 +5768,8 @@ mips_skip_pic_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
          && (stub_words[1] & 0xfc000000U) == 0x08000000
          && (stub_words[2] & 0xffff0000U) == 0x27390000
          && stub_words[3] == 0x00000000)
-       return (((stub_words[0] & 0x0000ffff) << 16)
-               + (stub_words[2] & 0x0000ffff));
+       return ((((stub_words[0] & 0x0000ffff) << 16)
+                + (stub_words[2] & 0x0000ffff)) ^ 0x8000) - 0x8000;
     }
 
   /* Not a recognized stub.  */