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,