This is the mail archive of the
rda@sources.redhat.com
mailing list for the rda project.
[PATCH] linux-target.c: Fix MIPS software single step
- From: Kevin Buettner <kevinb at redhat dot com>
- To: rda at sources dot redhat dot com
- Date: Thu, 8 May 2003 22:16:43 -0700
- Subject: [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);