Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@mips.com>
To: gdb-patches@sources.redhat.com
Cc: Nigel Stephens <nigel@mips.com>,
	 "Maciej W. Rozycki" <macro@linux-mips.org>
Subject: MIPS/Linux: Single-stepping running away
Date: Thu, 07 Oct 2004 17:12:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.61.0410071758320.19346@perivale.mips.com> (raw)

Hello,

 I've found two bugs in gdb that lead to single-stepping over branches 
failing under specific conditions -- the code tests register numbers 
instead of their values for a few variants of branches.  Here is an 
obvious fix.  It applies against the head.

2004-10-07  Maciej W. Rozycki  <macro@mips.com>

	* mips-tdep.c (mips32_next_pc): Check the register's contents,
	not its number for BLEZ/BLEZL and BGTZ/BGTZL.

 Please apply.

  Maciej

gdb-mips32_next_pc.patch
diff -up --recursive --new-file src.macro/gdb/mips-tdep.c src/gdb/mips-tdep.c
--- src.macro/gdb/mips-tdep.c	2004-09-28 14:04:51.000000000 +0000
+++ src/gdb/mips-tdep.c	2004-10-07 16:26:14.000000000 +0000
@@ -1273,7 +1273,7 @@ mips32_next_pc (CORE_ADDR pc)
 	    pc += 8;
 	  break;
 	case 6:		/* BLEZ, BLEZL */
-	  if (read_signed_register (itype_rs (inst) <= 0))
+	  if (read_signed_register (itype_rs (inst)) <= 0)
 	    pc += mips32_relative_offset (inst) + 4;
 	  else
 	    pc += 8;
@@ -1281,7 +1281,7 @@ mips32_next_pc (CORE_ADDR pc)
 	case 7:
 	default:
 	greater_branch:	/* BGTZ, BGTZL */
-	  if (read_signed_register (itype_rs (inst) > 0))
+	  if (read_signed_register (itype_rs (inst)) > 0)
 	    pc += mips32_relative_offset (inst) + 4;
 	  else
 	    pc += 8;


             reply	other threads:[~2004-10-07 17:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-07 17:12 Maciej W. Rozycki [this message]
2004-10-07 17:15 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0410071758320.19346@perivale.mips.com \
    --to=macro@mips.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=macro@linux-mips.org \
    --cc=nigel@mips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox