Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* MIPS/Linux: Single-stepping running away
@ 2004-10-07 17:12 Maciej W. Rozycki
  2004-10-07 17:15 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Maciej W. Rozycki @ 2004-10-07 17:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: Nigel Stephens, Maciej W. Rozycki

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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-07 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-07 17:12 MIPS/Linux: Single-stepping running away Maciej W. Rozycki
2004-10-07 17:15 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox