This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] MIPS: Atomic sequence emulation branch decoding fix


 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  <>

	* mips-tdep.c (deal_with_atomic_sequence): Fix the handling
	of BLTZ* and BGEZ* instructions.


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.  */
 	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* */
 	case 2: /* J */
 	case 3: /* JAL */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]