From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +SnfCCVjYmrXVSoAWB0awg (envelope-from ) for ; Thu, 23 Jul 2026 14:53:25 -0400 Received: by simark.ca (Postfix, from userid 112) id 209441E09E; Thu, 23 Jul 2026 14:53:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BFA101E033 for ; Thu, 23 Jul 2026 14:53:24 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8882F4BA79B0 for ; Thu, 23 Jul 2026 18:53:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8882F4BA79B0 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by sourceware.org (Postfix) with ESMTP id 9372F4BA7993 for ; Thu, 23 Jul 2026 18:53:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9372F4BA7993 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9372F4BA7993 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=78.133.224.34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784832781; cv=none; b=Nt7aW3/NYYx3pwNrQts1vjeZnvTZWjaWFJVeuYud7dvmQiiBEQ+i/jd+B4M1a3+6c48TN+d6E83Ht4DNoKXBfFR42kag7MtIGtHZCP7ieqR2ySlar22tmEgDMA/zX+q+8AUXkSKG8kIYNoTL6VOh2LUklyvGR0wEA85bfnYzutA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784832781; c=relaxed/simple; bh=l7PI5TYqsfzuis+r+h5HQPA7c0AF5l+cb87MQQag83w=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=BXYWNpBZXjCGYo+EXfqzGVvhRyWPSS6ONAj4qf4S2ChSneBxADK1As0qf0p35+snkwJbyJj0P1nT/5F3q1MPV0v3LAjlYBN/UCl/qqS60Q8uaGIytqjJ99XCVGlXccdfoexa2Hjz0iF6bFfcVYf0W7ltcwU5fLHVl9UeIqREipM= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9372F4BA7993 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 1A4B19200BB; Thu, 23 Jul 2026 20:53:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 13E579200B4; Thu, 23 Jul 2026 19:53:01 +0100 (BST) Date: Thu, 23 Jul 2026 19:53:00 +0100 (BST) From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Jovan Dmitrovic , Djordje Todorovic , Milica Matic , "Maciej W. Rozycki" Subject: [PATCH 4/7] MIPS: Correct BLEZL single-stepping In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "Maciej W. Rozycki" Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: Maciej W. Rozycki Correct `mips32_next_pc' and also consider BLEZL taken for the value of zero held in the source register as per the instruction's semantics, restoring `less_zero_branch' label discarded with commit 54f1137d66be and actually matching the comment present in the source. Verification will be provided with the test cases in the next change. Co-Authored-By: Andrew Bennett Co-Authored-By: Matthew Fortune Co-Authored-By: Faraz Shahbazker Co-Authored-By: Milica Matic Co-Authored-By: Jovan Dmitrović Approved-by: Maciej W. Rozycki --- gdb/mips-tdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) gdb-mips-next-pc-blezl.diff Index: binutils-gdb/gdb/mips-tdep.c =================================================================== --- binutils-gdb.orig/gdb/mips-tdep.c +++ binutils-gdb/gdb/mips-tdep.c @@ -1662,7 +1662,7 @@ mips32_next_pc (struct regcache *regcach case 1: /* BNEL */ goto neq_branch; case 2: /* BLEZL */ - goto less_branch; + goto less_equal_branch; case 3: /* BGTZL */ goto greater_branch; default: @@ -1751,7 +1751,6 @@ mips32_next_pc (struct regcache *regcach case 2: /* BLTZL */ case 16: /* BLTZAL */ case 18: /* BLTZALL */ - less_branch: if (regcache_raw_get_signed (regcache, itype_rs (inst)) < 0) pc += mips32_relative_offset (inst) + 4; else @@ -1817,6 +1816,7 @@ mips32_next_pc (struct regcache *regcach pc += 8; break; case 6: /* BLEZ, BLEZL */ + less_equal_branch: if (regcache_raw_get_signed (regcache, itype_rs (inst)) <= 0) pc += mips32_relative_offset (inst) + 4; else