From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5924 invoked by alias); 7 Oct 2004 17:12:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5895 invoked from network); 7 Oct 2004 17:12:30 -0000 Received: from unknown (HELO dmz.algor.co.uk) (62.254.210.145) by sourceware.org with SMTP; 7 Oct 2004 17:12:30 -0000 Received: from alg158.algor.co.uk ([62.254.210.158] helo=olympia.mips.com) by dmz.algor.co.uk with esmtp (Exim 3.35 #1 (Debian)) id 1CFbxv-0005mL-00; Thu, 07 Oct 2004 18:22:07 +0100 Received: from perivale.mips.com ([192.168.192.200]) by olympia.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1CFboI-00035l-00; Thu, 07 Oct 2004 18:12:10 +0100 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 3.36 #1 (Debian)) id 1CFboI-0005EX-00; Thu, 07 Oct 2004 18:12:10 +0100 Date: Thu, 07 Oct 2004 17:12:00 -0000 From: "Maciej W. Rozycki" To: gdb-patches@sources.redhat.com cc: Nigel Stephens , "Maciej W. Rozycki" Subject: MIPS/Linux: Single-stepping running away Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MTUK-Scanner: Found to be clean X-MTUK-SpamCheck: not spam, SpamAssassin (score=-4.883, required 4, AWL, BAYES_00) X-SW-Source: 2004-10/txt/msg00131.txt.bz2 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 * 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;