This is the mail archive of the rda@sources.redhat.com mailing list for the rda 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] linux-target.c: Fix MIPS software single step


I've just committed the patch below.  It fixes some rather odd
problems that I was seeing with GDB's ``step'' and ``next'' commands
when debugging MIPS floating point code.

	* linux-target.c (mips_singlestep): Don't interpret all coprocessor
	instructions as conditional branches.

Index: linux-target.c
===================================================================
RCS file: /cvs/src/src/rda/unix/linux-target.c,v
retrieving revision 1.6
diff -u -p -r1.6 linux-target.c
--- linux-target.c	10 Apr 2003 20:35:54 -0000	1.6
+++ linux-target.c	9 May 2003 05:11:26 -0000
@@ -2640,6 +2640,15 @@ mips_singlestep (struct gdbserv *serv, p
     targ |= (insn.j_format.target << 2);
     break;
 
+  /* Some cop instructions are conditional... */
+  case cop0_op:
+  case cop1_op:
+  case cop2_op:
+    if (insn.i_format.rs != bc_op)
+      break;
+    else
+      ; /* fall through... */
+
   /*
    * These are conditional.
    */
@@ -2651,9 +2660,6 @@ mips_singlestep (struct gdbserv *serv, p
   case blezl_op:
   case bgtz_op:
   case bgtzl_op:
-  case cop0_op:
-  case cop1_op:
-  case cop2_op:
   case cop1x_op:
     is_branch = is_cond = 1;
     targ += 4 + (insn.i_format.simmediate << 2);


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