Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/gdb6/gdb Branch with delay slot executes delay slot...



details:   https://anonhg.NetBSD.org/src/rev/1eb0ecf400ae
branches:  trunk
changeset: 761643:1eb0ecf400ae
user:      uwe <uwe%NetBSD.org@localhost>
date:      Fri Feb 04 00:05:29 2011 +0000

description:
Branch with delay slot executes delay slot even if branch is not
taken, so adjust next_pc logic accordingly.  Fixes SIGILL
(breakpoint's "trapa" causes an illegal slot instruction exception)
when stepping through such branches.

diffstat:

 gnu/dist/gdb6/gdb/shnbsd-tdep.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 8fe5b2652baa -r 1eb0ecf400ae gnu/dist/gdb6/gdb/shnbsd-tdep.c
--- a/gnu/dist/gdb6/gdb/shnbsd-tdep.c   Thu Feb 03 22:16:11 2011 +0000
+++ b/gnu/dist/gdb6/gdb/shnbsd-tdep.c   Fri Feb 04 00:05:29 2011 +0000
@@ -286,14 +286,14 @@
     {
       sr = read_register (SR_REGNUM);
 
+      delay_slot = CONDITIONAL_BRANCH_SLOT_P(insn);
       if (!CONDITIONAL_BRANCH_TAKEN_P(insn, sr))
-       next_pc = pc + 2;
+       next_pc = pc + (delay_slot ? 4 : 2);
       else
        {
          displacement = shnbsd_displacement_8 (insn);
 
          next_pc = pc + 4 + (displacement << 1);
-         delay_slot = CONDITIONAL_BRANCH_SLOT_P(insn);
        }
     }
 



Home | Main Index | Thread Index | Old Index