* m88k-tdep.c (m88k_analyze_prologue): Fix handling of branch
authorMark Kettenis <kettenis@gnu.org>
Sun, 30 May 2004 18:16:31 +0000 (18:16 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 30 May 2004 18:16:31 +0000 (18:16 +0000)
instructions.
(m88k_frame_prev_register): Simplify code a bit.

gdb/ChangeLog
gdb/m88k-tdep.c

index 78e93ba8eb22238889aaa60dc71d0dce1c51f631..2a7600e12574eeec2e52f0c128aaba343acf7c4c 100644 (file)
@@ -1,5 +1,9 @@
 2004-05-30  Mark Kettenis  <kettenis@gnu.org>
 
+       * m88k-tdep.c (m88k_analyze_prologue): Fix handling of branch
+       instructions.
+       (m88k_frame_prev_register): Simplify code a bit.
+
        * amd64-tdep.c (amd64_supply_fpregset): Adjust comment.
        (amd64_collect_fpregset): New function.
        (amd64_regset_from_core_section): Use amd64_collect_fpregset.
index 42a702d064f4bd7804c64be8d092ab4d63f667cf..215f1db825b64a12564719c64022f41e95dff954 100644 (file)
@@ -607,7 +607,7 @@ m88k_analyze_prologue (CORE_ADDR pc, CORE_ADDR limit,
              the instruction in the delay slot might be.  Limit the
              prologue analysis to the delay slot and record the branch
              instruction as the end of the prologue.  */
-         limit = pc + M88K_INSN_SIZE;
+         limit = min (limit, pc + 2 * M88K_INSN_SIZE);
          end = pc;
          break;
 
@@ -736,11 +736,9 @@ m88k_frame_prev_register (struct frame_info *next_frame, void **this_cache,
                                    lvalp, addrp, realnump, valuep);
 
          pc = extract_unsigned_integer (valuep, 4);
-         if (regnum == M88K_SNIP_REGNUM)
+         if (regnum == M88K_SFIP_REGNUM)
            pc += 4;
-         else if (regnum == M88K_SFIP_REGNUM)
-           pc += 8;
-         store_unsigned_integer (valuep, 4, pc);
+         store_unsigned_integer (valuep, 4, pc + 4);
        }
 
       /* It's a computed value.  */