From nobody Tue Nov 26 06:46:41 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=1709641161; cv=none; d=zohomail.com; s=zohoarc; b=ECXKSxD6eHcmuRb0gml5i1BTi6BFCzp3fj79LvlGRzeysYsfYOSF4MZNanAz/c0lMv++0Ju2MYAXhnsoHqo/0UuTX8572uqHt/F/KXEMZoHI3aF11wYXilCzH7umn868HqYq3h1BRKdCrFt9MgTzovqS72ylMUXTqPheVkk6Idw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709641161; 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=UcgWSPHavk3jnzeArpwVhpqUMOHkHAZLH3BaPdead8s=; b=GKbpSAwf8dyCqpIzwC8YOerhrxrHApHLCZ3LuQ765suVCsN/yew+cyobAszJlyTezOzn1ZoVirwUmWOJff67OntugM2OT4uJKpG98b7cdhAX1zAhVTv4CCqxp02Qjx/4RgwVDhCd+p/7M5KAr8WqjMMdpecJkh8HRzwAR6l9lFM= 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 1709641161183141.80944151877316; Tue, 5 Mar 2024 04:19:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhTlJ-0000hX-EV; Tue, 05 Mar 2024 07:19:15 -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 1rhTl3-0008PV-7C for qemu-devel@nongnu.org; Tue, 05 Mar 2024 07:18:58 -0500 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhTkv-0003Ey-8r for qemu-devel@nongnu.org; Tue, 05 Mar 2024 07:18:56 -0500 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2d382a78c38so34208051fa.1 for ; Tue, 05 Mar 2024 04:18:48 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k4-20020a05600c1c8400b00412e556d4besm5271799wms.48.2024.03.05.04.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 04:18:47 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DE1675F9FB; Tue, 5 Mar 2024 12:10:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709641127; x=1710245927; 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=UcgWSPHavk3jnzeArpwVhpqUMOHkHAZLH3BaPdead8s=; b=QKwwoS0ayhUEegS00UJTOCSR29nMBAaWYEnKDZgXZLp9GRvjXbeqhuKq55QxUBIOCN y4DYcA6Pv2BLswRfqtb8TXNLbao1KV8yL+gtRxpQgWJ6hADfbK3kqL8IeOcskWww6pxb ulds9KF/8DTVKVQrPqrRnJgIKYWQaiKQodQw3mA+nW7pY/LXjFIyGBJdc8+Lu3CFzoT9 PBHcs6zJX/ExkIaLj7QdgOckCqCfeRQCOlyYukyuOXncwOXQ/F4lUwK1NVpaD1ati8Wv uSOniV9BVqTVgpwWBC0MOEnsFLWFC5GBfALzyaZnDmLKPn5uz5ZAD8ITp2xzTM5hjnAJ ZaFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709641127; x=1710245927; 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=UcgWSPHavk3jnzeArpwVhpqUMOHkHAZLH3BaPdead8s=; b=t+hO2/cyWbdZVzTAwwi1FzyScxJ6sBRhoVyNdk5u2Knbw1M9owEfKQwRKy9zBqRvq4 SJ6r0hevHL50Fw5WC5azuVUrY2HBCy8TQxEnJJnUIguuG73DZYMmyEYNkqtBOOTrPUfp XQjUyXO+XWww6XfU8SVOWO9Uz8zqfeE8hppBP0sIBPFIniV8+zkeQ78Xg/saGpwd4WsQ MFnb2OokD7e8SfHjCCN8LR7/s6z64/PnLYmjNlfJBqUTzQBnHOsDeUM9A/hvPX8rEJr0 bWSrWTxkFA7RcoHoFVXegqTJ4n6A145yfYJtelNzxkRKNArJotsb2n+34z0UzpTv7RZT ul/Q== X-Gm-Message-State: AOJu0YwhoRFFf8OzHiPBfF/9914v+rGxa5zdTYBwclfcNGibeQEjXOio xyq0T83ALejl6Ts7fbOjT/QoTELbFKdS7wXQ1TviA3/T/jRr75B775TeX4FDjPU= X-Google-Smtp-Source: AGHT+IH9KwVJTQeQEslJG89+vmGjqmmhWGi0+6NQxtwTOFdi4QGrRO1QXgsNsRlyY8haRvYRTzihfw== X-Received: by 2002:a05:6512:36c7:b0:513:3738:f831 with SMTP id e7-20020a05651236c700b005133738f831mr960024lfs.32.1709641127409; Tue, 05 Mar 2024 04:18:47 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Alistair Francis , Nicholas Piggin , Liu Zhiwei , Richard Henderson , Yanan Wang , qemu-s390x@nongnu.org, "Edgar E. Iglesias" , Eduardo Habkost , Daniel Henrique Barboza , Michael Rolnik , Daniel Henrique Barboza , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier , Yoshinori Sato , Laurent Vivier , Thomas Huth , Peter Maydell , Mahmoud Mandour , Brad Smith , Alistair Francis , Brian Cain , Cleber Rosa , John Snow , Marcel Apfelbaum , Pierrick Bouvier , Palmer Dabbelt , Riku Voipio , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Weiwei Li , Bin Meng , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Beraldo Leal , Kyle Evans , David Hildenbrand , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Alexandre Iooss , Warner Losh , qemu-riscv@nongnu.org, Ilya Leoshkevich Subject: [PATCH 26/29] disas: introduce show_opcodes Date: Tue, 5 Mar 2024 12:10:02 +0000 Message-Id: <20240305121005.3528075-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240305121005.3528075-1-alex.bennee@linaro.org> References: <20240305121005.3528075-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::230; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x230.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: 1709641161791100001 For plugins we don't expect the raw opcodes in the disassembly. We already deal with this by hand crafting our capstone call but for other diassemblers we need a flag. Introduce show_opcodes which defaults to off. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson --- include/disas/dis-asm.h | 8 ++++++++ disas/disas.c | 1 + 2 files changed, 9 insertions(+) diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h index 2324f6b1a46..b26867b6417 100644 --- a/include/disas/dis-asm.h +++ b/include/disas/dis-asm.h @@ -396,6 +396,14 @@ typedef struct disassemble_info { /* Command line options specific to the target disassembler. */ char * disassembler_options; =20 + /* + * When true instruct the disassembler it may preface the + * disassembly with the opcodes values if it wants to. This is + * mainly for the benefit of the plugin interface which doesn't want + * that. + */ + bool show_opcodes; + /* Field intended to be used by targets in any way they deem suitable. = */ void *target_info; =20 diff --git a/disas/disas.c b/disas/disas.c index 0d2d06c2ecc..17170d291ec 100644 --- a/disas/disas.c +++ b/disas/disas.c @@ -299,6 +299,7 @@ void disas(FILE *out, const void *code, size_t size) s.info.buffer =3D code; s.info.buffer_vma =3D (uintptr_t)code; s.info.buffer_length =3D size; + s.info.show_opcodes =3D true; =20 if (s.info.cap_arch >=3D 0 && cap_disas_host(&s.info, code, size)) { return; --=20 2.39.2