From patchwork Mon Mar 4 19:13:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 777788 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp94533wrs; Mon, 4 Mar 2024 11:14:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVA6iaa2+n7YU4ah/qm5NMMr3fXPmFdJz4al3a96EgByaKuRxYIEc2XqKOwb8zJt46AZ0b3+TqrK22m99qNWn2D X-Google-Smtp-Source: AGHT+IE9JnSytD6OYzIsFE/NO/roffxfe2MdP2nehuKGzEqHrtEl6GmLsP5fcP4bCo3a2u6Anb3i X-Received: by 2002:a37:c44a:0:b0:788:1e80:9ea3 with SMTP id h10-20020a37c44a000000b007881e809ea3mr6190399qkm.35.1709579699336; Mon, 04 Mar 2024 11:14:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709579699; cv=none; d=google.com; s=arc-20160816; b=Qo0XpDRAfzEWkZJ9jSNu58u9MAOY0SeM6Y+qBJLrMi9VyWDqUiyKZvJRaP0Z0FZ1Ga 5ou+nuGU8nOwfljr/V8KouJVswABT1ahyec0z2c6LJHiO0RBH/Pj0PEGqK1tKkOf1sVU LdR7fVHHXWxooQh8Ei77yyhLsYQDAxhKyA67WuEY5sp6OxMhxawhFxVgRCCscPo0CDSI dW+jyuh/1kTsJpGDMsG4NnMcXvnhTvVRzf8GvR5x1WoGBxdvgEoi7oPDUukgjEmo/aT3 KjEJxpzV7WJwaFW0Wp/rW5DusslNt04M7fWA7BIngPgYdkxtWC7+xT9S41BLedFzJXar VrNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m0d/Phj/7yIgxNG2HYpQbbRbVtCMOAMLsAUj8z9GTaE=; fh=b/fM3Azt1fJndKkBUw6/kyP4UN6WY/kGpFR2FNJIEXM=; b=M0T+8ZmmNaC0+wF6YYzIY2eIOF8hau9VRZXlbVHT1gSVBqOW3KTTYgp/+foJidX5Ej 4OEBQB5785dtFl7ed0NWxdQhtfItp3K3rOY0u3HHkBFhKLR2ZJ5L6ZqLdkZMz6/dFMus SDeA30fDtLuQ0hZwUAajW87io56igj+XFebF+pBbjZzqlVb4yCOzad1XzFpSvcrMb0DV PdXw5ITNgyQeW+UiONcWziTpottkNwA5UYnBEv/B7VajRYAXHdFn5PqjCdHmwBPwD0RU 8YsF71sYN2tzqebbuzmEkveQb7Wa8l4EC4jTp+C9v6+/JvGwHRi7/Uc8WAqc4n3kZeiF MAsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q/buDX0g"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s8-20020a05620a030800b00788316f51e4si829382qkm.4.2024.03.04.11.14.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2024 11:14:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q/buDX0g"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhDkt-00039L-NQ; Mon, 04 Mar 2024 14:13:43 -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 1rhDks-00038a-LO for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:42 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhDkq-0001au-FA for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:42 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-412e784060cso5735565e9.1 for ; Mon, 04 Mar 2024 11:13:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709579618; x=1710184418; 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=m0d/Phj/7yIgxNG2HYpQbbRbVtCMOAMLsAUj8z9GTaE=; b=q/buDX0golA1fhq4rpurn8iIdNHffew24Ace9ub4WuZstFE8TCYxej4h8oYnWxjPKG xBja1V/pjUx3sujJYBEr8dANtzGOJxjGRiQO5dS4wxd0c12EnwWg37sDESoJ45x6sz3N nypAIqWp3oixSz+ZTgQw7O5LvDzHQRM6hMQoOfxOIIOQeUyMSyttu0cx/s1GGlmCJSjv 2Qifmbep+/BtEEHQBWFDknuCSVNurTHbXQ+AMMXnuGizuN5PZfNrzDKV+IPMJuR3QDF0 aR8Az5dN+HloxLBkX0EFokbyYDPGYF8DEtcuujAG4QPutS+LaGKPx0CUxRu2S5xM6sit JZJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709579618; x=1710184418; 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=m0d/Phj/7yIgxNG2HYpQbbRbVtCMOAMLsAUj8z9GTaE=; b=Za2GVIAqePaUSevjSUNpy87l8wJL0Z3mvBZ9M+qMrXvi/96vdM/klkEcQIGNhqKKIA igZLcwMnnjlxWsqhfrq2evpXVK9YrCRVWOQ/GuS+KJ77ndz6bIAsjqM5S9m7+xrF6T+x vUZexy5NqzfqBqCsODgHZs+XGi4PBN9kniMZ40ARwfOIkIvthQ3QZ0xlymAWT7m/cTF7 EzSIZLUZtZC8pox6zot3t5kqrEoXKs5qIZV0ZslWR0Zi6r+S0dXMlf/nqv6eb9PUh2f4 uGoLD8raC4KHvk9HAe4nfpEj7uuDi27kXqPZWlJBA4jmnUR0GsX05i4WhXvzAaX3xH0l U1sA== X-Gm-Message-State: AOJu0Ywc/nkqGR74rc19gh1WijAdt9dcEtMrUFXMEhIl3fO6XjBZyxTy ENJQ1EpKpWuvnVdOHoJOTxFDT7P81LSmVpTAgi19k6pwmilGFuBVogSq8TkKtTU= X-Received: by 2002:adf:a792:0:b0:33e:4865:9ced with SMTP id j18-20020adfa792000000b0033e48659cedmr47540wrc.2.1709579617987; Mon, 04 Mar 2024 11:13:37 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p8-20020a5d68c8000000b0033d87f61613sm12891321wrw.58.2024.03.04.11.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 11:13:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 364D75F8A2; Mon, 4 Mar 2024 19:13:37 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Palmer Dabbelt , Richard Henderson , qemu-riscv@nongnu.org, Song Gao , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 1/4] disas: introduce no_raw_bytes Date: Mon, 4 Mar 2024 19:13:34 +0000 Message-Id: <20240304191337.3101411-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240304191337.3101411-1-alex.bennee@linaro.org> References: <20240304191337.3101411-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.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=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org For plugins we don't expect the raw bytes in the disassembly. We already deal with this by hand crafting our capstone call but for other diassemblers we need a flag. Signed-off-by: Alex Bennée --- include/disas/dis-asm.h | 7 +++++++ disas/disas.c | 1 + 2 files changed, 8 insertions(+) diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h index 2324f6b1a46..5c32e7a310c 100644 --- a/include/disas/dis-asm.h +++ b/include/disas/dis-asm.h @@ -396,6 +396,13 @@ typedef struct disassemble_info { /* Command line options specific to the target disassembler. */ char * disassembler_options; + /* + * When true instruct the disassembler to not preface opcodes with + * raw bytes. This is mainly for the benefit of the plugin + * interface. + */ + bool no_raw_bytes; + /* Field intended to be used by targets in any way they deem suitable. */ void *target_info; diff --git a/disas/disas.c b/disas/disas.c index 0d2d06c2ecc..feb5bc4b665 100644 --- a/disas/disas.c +++ b/disas/disas.c @@ -273,6 +273,7 @@ char *plugin_disas(CPUState *cpu, uint64_t addr, size_t size) s.info.buffer_vma = addr; s.info.buffer_length = size; s.info.print_address_func = plugin_print_address; + s.info.no_raw_bytes = true; if (s.info.cap_arch >= 0 && cap_disas_plugin(&s.info, addr, size)) { ; /* done */ From patchwork Mon Mar 4 19:13:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 777785 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp94309wrs; Mon, 4 Mar 2024 11:14:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXqJXhDsyNcIeN8FgOHo5P0i0+q6E1aKf3wIeIN6vX3sz+8KTH7MpjwSFzQR48kOJ3QLAyN7YL6if8YkA9pOXQ3 X-Google-Smtp-Source: AGHT+IGWppFdJ1FzqwEnMBIEWzBI83+U1d6J8uVkrjmN6lzozvLEBdL4KUPISYF/5q9FcYbE5OvH X-Received: by 2002:a0c:fba5:0:b0:690:6ca4:f231 with SMTP id m5-20020a0cfba5000000b006906ca4f231mr5116672qvp.30.1709579667869; Mon, 04 Mar 2024 11:14:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709579667; cv=none; d=google.com; s=arc-20160816; b=Ps+XjMONMZlrgoYHwZqJvfZ1WdrXVoCy5gOsotwDGLMOIP3P6vYNgbeb6qUY9xcHdy fdwsPVBGFtxh311IpBYEtzmG4JY1xbSFa0OyVPjMV79rEwExejr+UoLXn7LhaAj3BkC5 OI7akuX0QqJmyhNC+iHFVEHAExAoSsjauqp8+rw+eQLuuNU8xaK2dzz2rHUrLjCZAexn h3mWghgOLRhJ4RzFSATUh7/K+gr3OPEmPJ0TpIF8OsWEXKb2UIJv5zj2hIT5Babf3AUZ uQMgKuxmob5z4GD5Zm6c+ftEQk2YTgSkRlk5ibGSXlOAxxMM4QRAJMf+eGKw1fJb5qUQ Vleg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ffYxUIi2VesCW8E3hAaY86N1SXnFx+7CKtORz4AUgmU=; fh=b/fM3Azt1fJndKkBUw6/kyP4UN6WY/kGpFR2FNJIEXM=; b=CxCkhxYQL6qQdC/ZyS2F2CyKRrL0QEv2Xh5aJVmg61Yq5Kq9PNGCoil2KJaZY0xVYk xkCPqWJoN0p266T1CdD3jptjWB7IpzR06jV6cPmSyEad8DPMNNLO6dUK2qy6gqgRAS9a /qdA4HHXhXCUzFQLBiyT9Q4Q/h8e2r4I9X0VkFSlROdI5ltFbI1MvH/4VR+FuVO4vEZz DfiCQkFWy34lTTtpJE0n0v9PPNF7e4qq31JpNddHDNlPvCzPzO/EW3XPGdZsACOUrT/n pOyfKdC1GNKioqRq0usvZv6UrfDfwoD1ts1z/7SG9Zo/Dkl1EA1/Q6MY+x+L0Kkp287i IC7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PmFDnmuV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p10-20020a05621421ea00b006900690c1bbsi10476215qvj.237.2024.03.04.11.14.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2024 11:14:27 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PmFDnmuV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhDkw-0003A8-Mb; Mon, 04 Mar 2024 14:13:46 -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 1rhDkt-00039N-QA for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:43 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhDks-0001bM-Ad for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:43 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-412e90ef887so4755225e9.2 for ; Mon, 04 Mar 2024 11:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709579621; x=1710184421; 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=ffYxUIi2VesCW8E3hAaY86N1SXnFx+7CKtORz4AUgmU=; b=PmFDnmuV6pdVif8ImWmnSP8a85lP1gXCdoGZMgXNlJer/1/ZZBXIyS1xJUKQ+X/fkQ 3IXe7pB/k9om9Z75qW29S1QbkQKbF2Hy3qxfLe58SAe2uTCURFdpTGEfDuRfUOF/Bf96 ZRqwR5LBhRIxHw+9vLnt3NL9n5mkbM5p3RHI+zJWvFFj4K43ginE0AIPrno4jvUFkyRv 7Ou8nGUuUQCIHAxkeDD3PVq+WtDXau09WZDOXe600DkggYotwJAsdVCWssmI9O2+ZbmS bw0dA4s3nQbLZwKtZS1GMVV/Ej58ONg5x7L8EDuECdYIb5EviQcFSv0+Yw34thX3wjfe 4GXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709579621; x=1710184421; 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=ffYxUIi2VesCW8E3hAaY86N1SXnFx+7CKtORz4AUgmU=; b=lajRY3vm0UbW3H+8FdCLsTzyp2z3Suok4HPIMlWW0p+cgx51h0rPsQTLyCj3uUMjF7 jeM6XjMbLK5iXFkx1DB7/qXgpiy54ecK1Qf3OZtYpCRMPPGlmZkryOZDqDgXH2c0Q4eE p2vnxtptSICPF6624UN3RqeJjJ7ooQF2HH1pxx9RUeTNA9HephqiJyCFsS+bKuMQ7klY eQh3Zw401TVtOhL6OGMM1yoWTcZ3mY03yg4A1ilJBKt97Qfjd4WOkeC1U8ZQH5keARz9 DVenh77BKoQqu9OXu9v06dn1UVZ/fTtdFj6qDwQdMHWEmb1vxbzHoftufaSE7t9wGfv4 +WjA== X-Gm-Message-State: AOJu0YyQKcKrmZB/9mAsH9nsUwpSMJipfdvAD25OuEU1gWXyOoUMR2AI u77f1m8xSI1xoDzoB5kH2rCKkz2wgIku8sjAcR1K7CqQvQ2Rc0lfY4iYaUcjuew= X-Received: by 2002:adf:f04e:0:b0:33d:deb8:8bab with SMTP id t14-20020adff04e000000b0033ddeb88babmr7694640wro.53.1709579620799; Mon, 04 Mar 2024 11:13:40 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a16-20020a5d53d0000000b0033de10c9efcsm12920753wrw.114.2024.03.04.11.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 11:13:38 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4909C5F94F; Mon, 4 Mar 2024 19:13:37 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Palmer Dabbelt , Richard Henderson , qemu-riscv@nongnu.org, Song Gao , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 2/4] disas/hppa: honour no_raw_bytes Date: Mon, 4 Mar 2024 19:13:35 +0000 Message-Id: <20240304191337.3101411-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240304191337.3101411-1-alex.bennee@linaro.org> References: <20240304191337.3101411-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Alex Bennée --- disas/hppa.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/disas/hppa.c b/disas/hppa.c index 22dce9b41bb..17e4f1ccdc6 100644 --- a/disas/hppa.c +++ b/disas/hppa.c @@ -1972,9 +1972,11 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info) insn = bfd_getb32 (buffer); - info->fprintf_func(info->stream, " %02x %02x %02x %02x ", - (insn >> 24) & 0xff, (insn >> 16) & 0xff, - (insn >> 8) & 0xff, insn & 0xff); + if (!info->no_raw_bytes) { + info->fprintf_func(info->stream, " %02x %02x %02x %02x ", + (insn >> 24) & 0xff, (insn >> 16) & 0xff, + (insn >> 8) & 0xff, insn & 0xff); + } for (i = 0; i < NUMOPCODES; ++i) { From patchwork Mon Mar 4 19:13:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 777787 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp94523wrs; Mon, 4 Mar 2024 11:14:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV8q2sghBHourIL91JieOZrdGaxt3v06mb6qZWqtNIRzDbFVdnRYHnxOsi5oFLei9XSX9jlNui/Du39pYNhUe/5 X-Google-Smtp-Source: AGHT+IGW4kfG/j657CF/PaE5L0r7ylku6s3Ixnxis24dtaj0eBmRWNoDHwNun6pDgLKVbkdkLTaL X-Received: by 2002:ac8:58ce:0:b0:42e:f1ae:9e10 with SMTP id u14-20020ac858ce000000b0042ef1ae9e10mr3989076qta.57.1709579697945; Mon, 04 Mar 2024 11:14:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709579697; cv=none; d=google.com; s=arc-20160816; b=Ov2ex3tzEi7Aknuka4Qec7wJFY4ed17zBtR0gHbll8ugjZPLbyFsXCUnROz3ykOh5k 0PqC4W2NpwKtDTfiIIRlqxcRLdoSKkYo9k5Eo6MgFOz4/w3VoTZ6dBWHUQcqkxnEj3w7 PObPDH+59usdSXGgb15swFyvPoZqly2fNb544YYAueo4HuX5jOz11k3rOt6FWDbB0C7D wlqaqOa+IwIvoUhlJqwparoDjQuM5CdQjn7BVzRp13YkZe2kaJD4T/zydHeNQ6cqhE+0 nBjJq4QQZTxqRDaaGj9C4kLByfudSAcPOF7c8fQzT6g4aVtj1mo6obBjoNxx2vd0qwGY /+Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Pa44yMkxqpNsvSncvi7ekLjG5ubx8BtC53IgoytJ5A4=; fh=b/fM3Azt1fJndKkBUw6/kyP4UN6WY/kGpFR2FNJIEXM=; b=EBOfR8RzTC+7oBb2Q7cBHtRtl8pYl48e/fy7oBgDtgsOAiFtEBFVUCQ1QGGQUEo9Qb REewqnd6kr0M0tD0ckpiEHNoLO2NSN/6E+xxekB6m+/gT+4hEpi1yoW4+W/wJzXMt53D 37ezq0lbzq6RRQX/566cEijT84O8kLMUsGC5l/oP8ARZE3eFI0Sp/5g3lVz8g8kaAhLf ZGdjwHTle2V5fw0FMO8Ti+4Fn4WzQsokbK0oRNRQ3FvwDDB93wmCI5JJcylZJzgRDnjf m8U4U5RLaAPuZQ0r5FcCYQ+lL3Vg4hf4TJ6fZD7yeiGJD4PpXL5VIn3wOG02H9kfzNlO RvWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s0FuxQtb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j13-20020ac85f8d000000b0042ee0844badsi5069437qta.330.2024.03.04.11.14.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2024 11:14:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s0FuxQtb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhDkt-00038i-0N; Mon, 04 Mar 2024 14:13:43 -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 1rhDkr-00036h-Iq for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:41 -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 1rhDkq-0001ax-0B for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:41 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-33e2268ed96so2781611f8f.3 for ; Mon, 04 Mar 2024 11:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709579618; x=1710184418; 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=Pa44yMkxqpNsvSncvi7ekLjG5ubx8BtC53IgoytJ5A4=; b=s0FuxQtbhvpcHrrH7J0hi1jHaoo0D+IzAYFqHhI7UsncwwrGyySba9VtiyJzBbh6I9 LR92LN5GfRd0ItAHXJq+ApNtmmZ/Yq3HqEmjK35tY16+1aN3vRX6zx0tBMbzFb1UJZJJ WhUileUo2pjr8HfBG3vAwxwhKDKFU1KpRkfPL0JtOj7/BlIsPNnlnOUZdiwz3K9+dgk4 NOPU4js2ejLezU9b4IU0E2nmtMbBofHX8rHxKLU93iA9IVDG+wnPMPOhTLBIa8FtWPLR zx5Vnbz1+tOfsfqiNR7ylSPA4+zOkXU8v8i41aeXSVBp8ktC7jlNp23+p5oA71hps4W6 qNqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709579618; x=1710184418; 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=Pa44yMkxqpNsvSncvi7ekLjG5ubx8BtC53IgoytJ5A4=; b=KRdRa0GpdwKMVl/fO0FCwUBWxveyE2WO0wZW6St5lFJevYjxJY8Tw4NyzNGBV4QcwY LK2WRRKLHc5Jw1Pv5sMzosQtXRp3Cf8cc/mu1q90DITYSGkQUFCnMMTWQGS+3RMhsHgJ fUYJ7puWxLy7z+QWa4jmi8/5w/mUMoXnx9U2Q/dms9A6O8N8rvmOotWr33g+pBoimxCO b4BInQLOMqf9UHJkeC3+BaDzrvs7R0wJ4wSWy+h+rHikejIlJ9YtoR5/nJdGapwKakKY aupgYBEu24EBEmdpc2Kh3rC/X6+lPHOibsyv9GQeuTHg7W8Jmg+kO/3fhCr8ucWNfC1Q f9cQ== X-Gm-Message-State: AOJu0YwDzb70/+zIp9bfhfpkuagM3n6WG6pBw/0rhGZr2WYfzUX585ww kcqHZ7rHQDEgN8zFcBPivsuAdaN72G3jORTzZylyBvMMh41obcHw0jITSTx5NOc= X-Received: by 2002:adf:9d83:0:b0:33d:eda5:bef7 with SMTP id p3-20020adf9d83000000b0033deda5bef7mr6977181wre.59.1709579618381; Mon, 04 Mar 2024 11:13:38 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p3-20020a5d4583000000b0033b47ee01f1sm12866317wrq.49.2024.03.04.11.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 11:13:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5B6575F950; Mon, 4 Mar 2024 19:13:37 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Palmer Dabbelt , Richard Henderson , qemu-riscv@nongnu.org, Song Gao , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 3/4] target/loongarch: honour no_raw_bytes when disassembling Date: Mon, 4 Mar 2024 19:13:36 +0000 Message-Id: <20240304191337.3101411-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240304191337.3101411-1-alex.bennee@linaro.org> References: <20240304191337.3101411-1-alex.bennee@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This makes the output suitable when used for plugins. Signed-off-by: Alex Bennée --- target/loongarch/disas.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/target/loongarch/disas.c b/target/loongarch/disas.c index 2040f3e44db..b9118878d97 100644 --- a/target/loongarch/disas.c +++ b/target/loongarch/disas.c @@ -120,10 +120,15 @@ static const char *get_csr_name(unsigned num) csr_names[num] : "Undefined CSR"; } -#define output(C, INSN, FMT, ...) \ -{ \ - (C)->info->fprintf_func((C)->info->stream, "%08x %-9s\t" FMT, \ - (C)->insn, INSN, ##__VA_ARGS__); \ +#define output(C, INSN, FMT, ...) \ + { \ + if ((C)->info->no_raw_bytes) { \ + (C)->info->fprintf_func((C)->info->stream, "%-9s\t" FMT, \ + INSN, ##__VA_ARGS__); \ + } else { \ + (C)->info->fprintf_func((C)->info->stream, "%08x %-9s\t" FMT,\ + (C)->insn, INSN, ##__VA_ARGS__); \ + } \ } #include "decode-insns.c.inc" From patchwork Mon Mar 4 19:13:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 777786 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp94420wrs; Mon, 4 Mar 2024 11:14:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUqQaieKkQzHB4M8/mZdaKpShXBrKvWEVUhxInTCnIBt5sGJQJkAfJnI8EdW43czmSeFGhkyT/JpQHQsqGVwNoh X-Google-Smtp-Source: AGHT+IG/pTXgNjqbaJj9sb4XfLQn3jdQ9/w2cEWfoShDJ4n6LOtIOZk9B9XpRRNH3gRLK539Ecpl X-Received: by 2002:a05:622a:4b:b0:42e:efa4:5840 with SMTP id y11-20020a05622a004b00b0042eefa45840mr4577720qtw.31.1709579682603; Mon, 04 Mar 2024 11:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709579682; cv=none; d=google.com; s=arc-20160816; b=YMGTATJWhKcKcBS3QMizrcV7hq0gCdaP1WXwcNqpE8PN+x0tMXBmXumiq1+5Cr/N6O KjkZDsVUVa9rBFTwRjYwnQik8feDw9m5PmyP0Gi2mh4NsXS0uAEPqrxlK/qO6SFAmIsd c8gUQ4v3xuDr2m18j8lJYgkPhTDco0hHuYtb4xj0uJNKNduO4fQHsxfzF84T7Z0GDhlN kv5aLIyKw+vZNyNoYGthowRhSAaDhJpt66UZZ7BYMbAYVYcN7870gvYwH9NguixcUaUh HJLT30D7+DJ/HPCuZHe/G0/e8KVwbE+raIToJillinDYGz7JwCoeT9L14yIP8/eutvMZ hXjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mJYQlLP/RL1iB+sA/9wIyNkwvTTFBy7MlRN8CyxoDMQ=; fh=b/fM3Azt1fJndKkBUw6/kyP4UN6WY/kGpFR2FNJIEXM=; b=RFjDWNk0RZY6YKZ2kr8ABjPhm17ZBFXJhJMKTQ/D4/5MJwbTd8nAO568AVvvfVZEcL tEeNheFijOAdBmpMHz4IcY1+dmYXatnL3d0lhB05e2QbRwsr6fd2t1t41AmGsLWKlwpS B37AdcH6uaTcag6YFoJ1re5hsKHF6T+7mMlmJTcxH/fPtELTYdh5g0+V+g4EXPwHaZAL MsAiFYl0aftiKtrCcsotHSDi8HVycjBbB070vVJmamiHTdLszjJBwEpEiSGvKH7JLe3j K6Rs2sTqV4jX3fCltKFYQRN9ldhu83mad/hSdc4KmCnUKc1bX7V10puwK8CF1vPlxoSM ezoQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kMvLpFNq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gy7-20020a056214242700b0068f737e83e1si10481872qvb.175.2024.03.04.11.14.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Mar 2024 11:14:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kMvLpFNq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhDkw-0003AB-O0; Mon, 04 Mar 2024 14:13:46 -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 1rhDkt-00038q-7m for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:43 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhDkr-0001bA-KE for qemu-devel@nongnu.org; Mon, 04 Mar 2024 14:13:42 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-412e90ef887so4755165e9.2 for ; Mon, 04 Mar 2024 11:13:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709579620; x=1710184420; 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=mJYQlLP/RL1iB+sA/9wIyNkwvTTFBy7MlRN8CyxoDMQ=; b=kMvLpFNqOFNsVYFlz3ZGajF8LmJqeBHlm91kdfK6x+9WUm39izGbcoQ6uwc999opOS 1pZBiiV04BjBNOouWdx/j6CPoaj3dJqyFTrSDX7lDodY6n9U10wtNcLQS2RNiA+CUU5R ZyzBoKC1/e51ZXqGTf8Vg4Fs2XNcLXtiQgHlqmI4nRA+GFjplUcy6rOXlfOBjeiGiJyv NFClGK2HTHcrkocNg7WwIkHBOixZxOzkFbEzH5E2J2PLf7yinL7FOE50kpQZaxtSfzE1 pMQT8QbbSz+kv6UHZThUVu08CgoClsSizt/AMeREoGoQfQc0/ck4TJSA96oxoS6pGhqz uB2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709579620; x=1710184420; 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=mJYQlLP/RL1iB+sA/9wIyNkwvTTFBy7MlRN8CyxoDMQ=; b=Rj8Hn8jPHNEXDL8of1jfvuAZgGl1hEY+oFa/fSIgglBOXx0Ib8BeDXclFSz2w4cHM7 Moo2yIYXipG1+qCjlgaSiHO3HrtixWBs3dn+oPaUOxCXa8lklbgVJFR+lAoXkiQ3Nd2h dveEhOqPTiIGfAsoYk54YJpax3RbYFABYwqjJdc/2DRyeOAnFJbN5m0fhOK+rhiSnoJP +5Ao6QbMoHDx+wSy4UCuvxtmyGAjg9Nje/A1B1ZYQcr6O9Tjf9CAEVOe9A6T817QpxEo lKoqZk4hoXQeMquNWPXX9MxlkKtPc3DzX0s9J6ZUuTZL9zAClx8jGKBv2MO7McKDM9++ asvw== X-Gm-Message-State: AOJu0Yxb9zMZtIpXzku7o0xZT8g97meDeG7snKuL3QLSU0sBjH6ZAqXT vi9G6XJNPqEJOPL0XiBlB7aKoAr3UNAIQxhUETWpYshJJbRkcfTz4Xn/ZMl339s= X-Received: by 2002:a05:600c:3111:b0:412:ada8:85a6 with SMTP id g17-20020a05600c311100b00412ada885a6mr7674285wmo.4.1709579620151; Mon, 04 Mar 2024 11:13:40 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id fl11-20020a05600c0b8b00b00412e2bb56bfsm4458708wmb.3.2024.03.04.11.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 11:13:37 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6E4515F954; Mon, 4 Mar 2024 19:13:37 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Palmer Dabbelt , Richard Henderson , qemu-riscv@nongnu.org, Song Gao , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 4/4] target/riscv: honour no_raw_bytes when disassembling Date: Mon, 4 Mar 2024 19:13:37 +0000 Message-Id: <20240304191337.3101411-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240304191337.3101411-1-alex.bennee@linaro.org> References: <20240304191337.3101411-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This makes the output suitable when used for plugins. Signed-off-by: Alex Bennée Acked-by: Alistair Francis --- disas/riscv.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/disas/riscv.c b/disas/riscv.c index 8a546d5ea53..86028efea85 100644 --- a/disas/riscv.c +++ b/disas/riscv.c @@ -5192,19 +5192,21 @@ print_insn_riscv(bfd_vma memaddr, struct disassemble_info *info, rv_isa isa) } } - 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->no_raw_bytes) { + 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; + } } disasm_inst(buf, sizeof(buf), isa, memaddr, inst,