Module Name:    src
Committed By:   uwe
Date:           Fri Feb  4 00:05:29 UTC 2011

Modified Files:
        src/gnu/dist/gdb6/gdb: shnbsd-tdep.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/gnu/dist/gdb6/gdb/shnbsd-tdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/gnu/dist/gdb6/gdb/shnbsd-tdep.c
diff -u src/gnu/dist/gdb6/gdb/shnbsd-tdep.c:1.5 src/gnu/dist/gdb6/gdb/shnbsd-tdep.c:1.6
--- src/gnu/dist/gdb6/gdb/shnbsd-tdep.c:1.5	Mon Oct 27 00:33:19 2008
+++ src/gnu/dist/gdb6/gdb/shnbsd-tdep.c	Fri Feb  4 00:05:29 2011
@@ -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);
 	}
     }
 

Reply via email to