From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21496 invoked by alias); 9 May 2003 22:12:07 -0000 Mailing-List: contact rda-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rda-owner@sources.redhat.com Received: (qmail 21463 invoked from network); 9 May 2003 22:12:07 -0000 Date: Fri, 09 May 2003 22:12:00 -0000 From: Kevin Buettner Message-Id: <1030509221200.ZM25523@localhost.localdomain> X-Mailer: Z-Mail (4.0.1 13Jan97 Caldera) To: rda@sources.redhat.com Subject: [PATCH] linux-target.c: More MIPS software single step fixes MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-q2/txt/msg00002.txt.bz2 I've just committed the patch below. Thanks to Chris Demetriou for feedback regarding problems with my earlier patch. * linux-target.c (mips_singlestep): Don't any consider cop0 or cop1x instructions to be conditional branches. Expand set of cop1 opcodes considered to be conditional branches. Index: linux-target.c =================================================================== RCS file: /cvs/src/src/rda/unix/linux-target.c,v retrieving revision 1.7 diff -u -p -r1.7 linux-target.c --- linux-target.c 9 May 2003 05:13:42 -0000 1.7 +++ linux-target.c 9 May 2003 21:48:43 -0000 @@ -2640,18 +2640,29 @@ mips_singlestep (struct gdbserv *serv, p targ |= (insn.j_format.target << 2); break; - /* Some cop instructions are conditional... */ - case cop0_op: + /* Some cop1 instructions are conditional branches. */ case cop1_op: + if (insn.i_format.rs == bc_op + || insn.i_format.rs == bc_op + 1 /* e.g, BC1ANY2 on MIPS-3D */ + || insn.i_format.rs == bc_op + 2 /* e.g, BC1ANY4 on MIPS-3D */) + { + is_branch = is_cond = 1; + targ += 4 + (insn.i_format.simmediate << 2); + } + break; + + /* Some cop2 instructions are conditional branches. */ case cop2_op: - if (insn.i_format.rs != bc_op) - break; - else - ; /* fall through... */ + /* MIPS32 Architecture For Programmers Volume II, rev 1.90 documents + bc2f, bc2fl, bc2t, and bc2tl. */ + if (insn.i_format.rs == bc_op) + { + is_branch = is_cond = 1; + targ += 4 + (insn.i_format.simmediate << 2); + } + break; - /* - * These are conditional. - */ + /* Other conditional branches... */ case beq_op: case beql_op: case bne_op: @@ -2660,7 +2671,6 @@ mips_singlestep (struct gdbserv *serv, p case blezl_op: case bgtz_op: case bgtzl_op: - case cop1x_op: is_branch = is_cond = 1; targ += 4 + (insn.i_format.simmediate << 2); break;