From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IRn5E/48g2p8RC0AWB0awg (envelope-from ) for ; Mon, 17 Aug 2026 12:55:26 -0400 Received: by simark.ca (Postfix, from userid 112) id 4F1481E033; Mon, 17 Aug 2026 12:55:26 -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 E06411E033 for ; Mon, 17 Aug 2026 12:55:25 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1FA024BAE7F8 for ; Mon, 17 Aug 2026 16:55:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FA024BAE7F8 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by sourceware.org (Postfix) with ESMTP id 8E4954BAE7D2 for ; Mon, 17 Aug 2026 16:53:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E4954BAE7D2 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 8E4954BAE7D2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2001:4190:8020::34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786985616; cv=none; b=Qt2bZ3hois8w/QV9kJhd/WO+iyXiIvvhQI/YEVP93X1HPcQ4dK/13b8AfYiw9yiBKVtvR2A+uFOCOtbPWiTSfDpbBVS+GhWWS7uS22aSnVNUD2v6tAIJ8HMTvuiBr3wgShG/Rd+JEQh+vU/Dr23kxs/Enx0xsZujc5obsxws+UE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786985616; c=relaxed/simple; bh=i2jGmbC9mgOilGN8nLc7SdJ5gH3uktItC1c3hYJU2rg=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=fC30x0Qr93eIpVjGCaWjx35gCfb5MtV0ReGM/akL5mNx+To10+NP2eTpk/cUZOTtpzUyuon483WCxTjSuXSRfFfFO00gaX8su4WKL67ivq2jxUF4w9hRakYmAHuq2mhCE6vJG5S+VfzKsyWYbqHdi8yXa+NPgz6IPh10bL6/q9E= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E4954BAE7D2 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 0660992009D; Mon, 17 Aug 2026 18:53:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 00ABE92009B; Mon, 17 Aug 2026 17:53:35 +0100 (BST) Date: Mon, 17 Aug 2026 17:53:35 +0100 (BST) From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Jovan Dmitrovic , Djordje Todorovic , Milica Matic , "Maciej W. Rozycki" Subject: [PATCH v2 04/12] 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 --- No change from v1 (4/7), . --- 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