From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yYnUOIA9g2pdRS0AWB0awg (envelope-from ) for ; Mon, 17 Aug 2026 12:57:36 -0400 Received: by simark.ca (Postfix, from userid 112) id E48A21E0A3; Mon, 17 Aug 2026 12:57:36 -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 [38.145.34.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 827F11E09B for ; Mon, 17 Aug 2026 12:57:36 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 405C04BAE7F3 for ; Mon, 17 Aug 2026 16:57:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 405C04BAE7F3 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by sourceware.org (Postfix) with ESMTP id C88794B99F55 for ; Mon, 17 Aug 2026 16:54:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C88794B99F55 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 C88794B99F55 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=1786985654; cv=none; b=M3KGNESuIoEx8TTDpXTUCAiVRbMFC/qO+UAqPWayz8o2Inf1dNgMS9IzWl0Wa4xSQhVYtaEReHwqLxJ8GRXifxLljjtAVRmnSSmwSvLv8sqsNowYcLj4g9pej2JxvHnj4eXg+EA9lO0ZYKObdEFTXDjfjAZpKC/mNKkljcukwMk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786985654; c=relaxed/simple; bh=lPcpU5SFttP1OoZaGWrFc3efHs382b2OR5vA4WDGfL4=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=Jey3SVnPauuvj8KvaR/TTj29Sh44rOSN7EWy1XzZRUMDwPbYZkVaKB3fvF+2+FUGcOzXShXdIztHNkjGyMfanQryZKEMcldqgF1lUUShX/qSTXrFQEc1ty+hQSBuLPVi1w+obCV8/1Nwm4iGSy1Ee6IsaxbcGyjLp/ETO6eEeB0= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C88794B99F55 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 52DBF9200BC; Mon, 17 Aug 2026 18:54:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 505E69200BB; Mon, 17 Aug 2026 17:54:14 +0100 (BST) Date: Mon, 17 Aug 2026 17:54:14 +0100 (BST) From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Jovan Dmitrovic , Djordje Todorovic , Milica Matic , "Maciej W. Rozycki" Subject: [PATCH v2 11/12] MIPS: Return correct size from `mips_insn_size' for MIPS16 JAL/X 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=US-ASCII 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 Among MIPS16 instructions not only the extended ones have the size of 4 bytes, but JAL and JALX as well, even though they have their distinct major opcode and do not use the EXTEND prefix. Update `mips_insn_size' accordingly. This function is currently never called for ISA_MIPS16, so the bug does not hit, but it will with the next change. Approved-By: Maciej W. Rozycki --- New change in v2. --- gdb/mips-tdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) gdb-mips16-insn-size-jal.diff Index: binutils-gdb/gdb/mips-tdep.c =================================================================== --- binutils-gdb.orig/gdb/mips-tdep.c +++ binutils-gdb/gdb/mips-tdep.c @@ -1563,7 +1563,8 @@ mips_insn_size (enum mips_isa isa, ULONG else return MIPS_INSN16_SIZE; case ISA_MIPS16: - if ((insn & 0xf800) == 0xf000) + if ((insn & 0xf800) == 0x1800 + || (insn & 0xf800) == 0xf000) return 2 * MIPS_INSN16_SIZE; else return MIPS_INSN16_SIZE;