From nobody Tue Nov 26 09:00:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1709736561; cv=none; d=zohomail.com; s=zohoarc; b=EEquIXxcntMSgj/zA8ADzRA4rSJTpB5RZW1UcKhHmSiwYDfo95OVSbTbs3FqKgIpwZLzQy71TX2/X6JZ1pUT4NcsgFUcwg4TXc7JI84+EWFFysb1UNYYGnu4gKNBA0AoTAH2BZsgxhxc6uBmQdsTqA/qgfRqesO3ehsZGUKGruM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709736561; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wx2eJ+KDhes0tXleUJeO3uNoYSnGN+NK8RX0V99627k=; b=gIuO1YdXME0TL3l/+SY/Y9k0OhmRg8ORRPMPvsu7eGloCr2vGKXMgboYk+HQ8pm30/fWjQSDAYNXnMbozUro7QCfoBlznHvtCYa6XalBN6R2lU/NLl7PV5RpEJGWrTmQPCqLv9jzwm/dfje4SHlBYfh1gUwOAff3l4fB4HS+40w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709736561462714.4739813792662; Wed, 6 Mar 2024 06:49:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhsZx-0006fq-6n; Wed, 06 Mar 2024 09:49:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhsZo-0006bc-Pq for qemu-devel@nongnu.org; Wed, 06 Mar 2024 09:49:01 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhsZn-0004EA-8h for qemu-devel@nongnu.org; Wed, 06 Mar 2024 09:49:00 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-33d6f26ff33so775623f8f.0 for ; Wed, 06 Mar 2024 06:48:58 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id bp16-20020a5d5a90000000b0033e0567e90bsm18436009wrb.5.2024.03.06.06.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 06:48:57 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2609A5F9FB; Wed, 6 Mar 2024 14:40:44 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709736537; x=1710341337; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wx2eJ+KDhes0tXleUJeO3uNoYSnGN+NK8RX0V99627k=; b=bzN25o/3dQJz/IHglzntxjO2gU8qSzscQ0OiaZuzrh6/Xvc5ovZL65N1eTLFhR7Mc/ 1AIhjIoPa3o2yx8MyOxqeDViNcqanUuACJon5TgWi7KhMBY+1int7w2gP2RWAMIdKjPq +t7ci6OCFlgDSbunAo8mAeP67yt91Lll2Dk+0h242ZpJ2fqBbA/yZAjHqkvWne7v/f60 EnypX7q2P7lukKhDQaQ5v+vmXP+V7jGj88VVlnRpTyuHmP9XCfdOrWuy9jsuJHOZC3Pm U2FWBGWZ+Cp5dwhwTCsH4E+qtA42lI/8pGFl9fyx0yYE3pd5gjhaFLJNaGYCOjZD4OOm 9iOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709736537; x=1710341337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wx2eJ+KDhes0tXleUJeO3uNoYSnGN+NK8RX0V99627k=; b=sLIgfQYjTPZi1bhHDCPmnzc1Dqd6LLMgZFhpTE8grwrtGAP6WGQ7n01uJ021f3sLGC 1kXnsnPndMgJYX2N1qr8b80ExmaiEJ2vYU4CigqqeReAZc70vVn9HgeAXK0ZW6GIVgsD Tz8XYq1nMcCstY6FeBlrVx+RYuLl1h/tRv3aLAHfk07B6k/CCPxFutnTdE2GY2oZvsSl /E0dd9CeG4a2Od6ENaYdacgE94CNdqvzGlSXUgS9rwadCtJY6kvt16McLFQWqLOA4trx 6pNh8OlIGjxZQFtK1cOgDsh8Tanx/5ovglBwUjBfGqGxwGJ/1JF74upEP9maJIoQ67n1 y9Ow== X-Gm-Message-State: AOJu0YxHAkFacspS2AD5spZ2y5P/t6wxy1tPJ70KE4gtSGlrmKseLm3Z M/ysg5BTqemMcl4DaNj0AqtBTr9XELgYMjZ5L/l/eEaNSAvx+n5Qdzl9WOpEqMg= X-Google-Smtp-Source: AGHT+IFTVngPAPsw1J8AaQ/GYWiUnrS87kLbRDO3qq/CDznmNsQ2muUiwI7c2gJZTpdy0BY54MsRqw== X-Received: by 2002:a5d:6145:0:b0:33e:187e:a5b1 with SMTP id y5-20020a5d6145000000b0033e187ea5b1mr10359305wrt.37.1709736537725; Wed, 06 Mar 2024 06:48:57 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Palmer Dabbelt , Alistair Francis , qemu-riscv@nongnu.org (open list:RISC-V TCG target) Subject: [PULL 29/29] target/riscv: honour show_opcodes when disassembling Date: Wed, 6 Mar 2024 14:40:41 +0000 Message-Id: <20240306144041.3787188-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240306144041.3787188-1-alex.bennee@linaro.org> References: <20240306144041.3787188-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1709736561855100001 This makes the output suitable when used for plugins. Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20240305121005.3528075-30-alex.bennee@linaro.org> diff --git a/disas/riscv.c b/disas/riscv.c index 8a546d5ea53..e236c8b5b7c 100644 --- a/disas/riscv.c +++ b/disas/riscv.c @@ -5192,19 +5192,21 @@ print_insn_riscv(bfd_vma memaddr, struct disassembl= e_info *info, rv_isa isa) } } =20 - switch (len) { - case 2: - (*info->fprintf_func)(info->stream, INST_FMT_2, inst); - break; - case 4: - (*info->fprintf_func)(info->stream, INST_FMT_4, inst); - break; - case 6: - (*info->fprintf_func)(info->stream, INST_FMT_6, inst); - break; - default: - (*info->fprintf_func)(info->stream, INST_FMT_8, inst); - break; + if (info->show_opcodes) { + switch (len) { + case 2: + (*info->fprintf_func)(info->stream, INST_FMT_2, inst); + break; + case 4: + (*info->fprintf_func)(info->stream, INST_FMT_4, inst); + break; + case 6: + (*info->fprintf_func)(info->stream, INST_FMT_6, inst); + break; + default: + (*info->fprintf_func)(info->stream, INST_FMT_8, inst); + break; + } } =20 disasm_inst(buf, sizeof(buf), isa, memaddr, inst, --=20 2.39.2