This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] MIPS: Atomic sequence emulation branch decoding fix
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Wed, 23 Nov 2011 18:45:08 +0000
- Subject: [PATCH] MIPS: Atomic sequence emulation branch decoding fix
Hi,
The minor opcode field of REGIMM major opcode branches is decoded
incorrectly. These branches match the x00xx pattern in the opcode field
(that overlaps with the RT field of some other instructions that do not
use a minor opcode); the change below reflects this. As this field is
only 5 bits wide, the 0xc0 mask makes no sense at all actually.
As the atomic sequence emulation is only used on soft-stepping targets I
have only regression tested it (successfully) for mips-linux-gnu; any
bare-iron testing is irrelevant for this code as it's never executed on
those targets. OK to apply?
2011-11-22 Maciej W. Rozycki <macro@codesourcery.com>
gdb/
* mips-tdep.c (deal_with_atomic_sequence): Fix the handling
of BLTZ* and BGEZ* instructions.
Maciej
gdb-mips-branch-decode-fix.diff
Index: gdb-fsf-trunk-quilt/gdb/mips-tdep.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/mips-tdep.c 2011-11-23 02:42:50.565454320 +0000
+++ gdb-fsf-trunk-quilt/gdb/mips-tdep.c 2011-11-23 02:43:11.205560945 +0000
@@ -2647,7 +2647,7 @@ deal_with_atomic_sequence (struct gdbarc
return 0; /* fallback to the standard single-step code. */
break;
case 1: /* REGIMM */
- is_branch = ((itype_rt (insn) & 0xc0) == 0); /* B{LT,GE}Z* */
+ is_branch = ((itype_rt (insn) & 0xc) == 0); /* B{LT,GE}Z* */
break;
case 2: /* J */
case 3: /* JAL */