From patchwork Thu May 23 15:08:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 165040 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2334803ili; Thu, 23 May 2019 08:18:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOMZ5GC3FEGz/tzYqwqonmHMWwip3K0bAwEk+aOKAE4hgkB+ueX/5HOoSUjvSGTQXqN2BM X-Received: by 2002:a50:911a:: with SMTP id e26mr44444949eda.25.1558624718864; Thu, 23 May 2019 08:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558624718; cv=none; d=google.com; s=arc-20160816; b=xI2nQUbpTof7ZYK8YoPRnQ1CkrF2rkS0RIfMZxK5NdgyPUwRZR7KrZmbrVll1g2P1v srge+7+6n19I7uQ+VRaOLJmC4fVD8gxfVlFUJetIt0RKmzpWm5j5VJLC2YEcrzlbdlGi 0rwkxUDFYAGEKk+3GQ+GHG6ea7Ru3rGeL1HBIexh6EYT/dQuO2uIxSRQix4ezHX5BhFq weSeVudQGY0VW9IDdgWVaklC/CgmxfWNfyzRpoz+v7ybdnkRtU8n+rX7fDNKk2coa8eT VY1BYQFGo3rQRi8kONp9XGZvAaPXY9/1XmmNNPNwah7RIAunMKwrYq395zZihcwIINXo bP8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=xcihCMTg6jd3N0tSpSeDkVUUj/HYgQaaJEhimiQbbQQ=; b=jIngUNgYRclORtDy8tAfb47vKgGRmNDiCBHLcVkTzGFdyk5QTmt+ndqlMthcGZNGMP bf3XRXjDo90nO6OjsnaVnzN7EzeMOsAKYdn1CUWiYVQL69mpuBNiLSbJ6TUEmYKWKgr8 R3ds7mIXpHZz1QBSdYrsgd+HKYMWdizl98P4pQw+AL0kpQamjVrhtON55CSlI3CCQNN+ g8xDBn1wBJ3fY7DK2rgTjOQw6XjQKfryO3sJZKlSbG9x5vw1T9gplOPoUoMawfN5UDdW Uo/X1LS79ojOKNy/cpZYVJAKmSkwtgLAp54cWxZpx36rmR84sdSjflO1Ei/Q0/UWZqad +12w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Cdi80Ybw; 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=fail (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 b55si19470625eda.70.2019.05.23.08.18.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 23 May 2019 08:18:38 -0700 (PDT) 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=fail header.i=@linaro.org header.s=google header.b=Cdi80Ybw; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:38676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTpUL-0007dD-On for patch@linaro.org; Thu, 23 May 2019 11:18:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTpKL-0007TY-3t for qemu-devel@nongnu.org; Thu, 23 May 2019 11:08:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTpKK-0001uF-5v for qemu-devel@nongnu.org; Thu, 23 May 2019 11:08:17 -0400 Received: from mail-ua1-x943.google.com ([2607:f8b0:4864:20::943]:42749) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTpKK-0001te-27 for qemu-devel@nongnu.org; Thu, 23 May 2019 11:08:16 -0400 Received: by mail-ua1-x943.google.com with SMTP id e9so2290451uar.9 for ; Thu, 23 May 2019 08:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xcihCMTg6jd3N0tSpSeDkVUUj/HYgQaaJEhimiQbbQQ=; b=Cdi80Ybw8+jb/EdnRp2dqA8qJI8x0fiYppUCb697NL0GCj84d6jCBwHrmgtoRpeD29 VExKmV3BAGRuusj19+Hb1cQ+8nyXpZwJuU6+P/ayhHBlhFGIthz2FhODYYB3jXxHCRaR iMyeDvt6KZ8P34i+1YueaTvZWVhptTo/2FO6Cl+EPSlCTld57/TuhEbl4CceGYabS0nJ IXANE/KKkmzDdXn5GD4Py6IxYaGWUwt2HqjUylbsq69IG/UiosOELD98CMkJBL/uQwVw 3ZpRKBEMXTuu6/4pkKS9pPVbTY/LMPbmDeNkN2UYRS32vFauhaes6CE6QiQ4zsvSlj/f cLoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xcihCMTg6jd3N0tSpSeDkVUUj/HYgQaaJEhimiQbbQQ=; b=ccxLgb8T34BLBECF5AnNqt4mYA39nr5XQfMsADrfxI4kPA2uLpN+yHaujyWstUQe5J o3oERcHPnXEQYDsc+N10xZrhP7NEiBqyrIrqXJOV7HeWMkjRx3L6dW6J4HdrdX7bk27R Fb1qVzlXsaXVLbYfTbmAvr4hPre8RiB9EwunlpyRBofrNSvg1U4EHxFYsavVF9t8KNIU /unHhJzZUsoQPVXxIEqPO3rtlQX2pHFuyN1J8k5v1xHAug/prLmrYJyAXW1KZ/8pme8z I1iauwnKMZf6OERk0IIog95qJnAzRXXTzU7HYfBg0/CJtvKxU4bM/BPUVj6o5JLnbAxd Ly9g== X-Gm-Message-State: APjAAAXQZfwDadIHeB1SBgR2fcqHZeUKnebMG8D1Dsv75BtHH4ENbF9d uYSIYYHxcruGxtG8zFc4Emq/b795QyY= X-Received: by 2002:ab0:29cc:: with SMTP id i12mr39566731uaq.12.1558624094878; Thu, 23 May 2019 08:08:14 -0700 (PDT) Received: from localhost.localdomain (ip-173-130-215-183.orldfl.spcsdns.net. [173.130.215.183]) by smtp.gmail.com with ESMTPSA id p70sm4227462vsd.25.2019.05.23.08.08.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 May 2019 08:08:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 11:08:03 -0400 Message-Id: <20190523150803.31504-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190523150803.31504-1-richard.henderson@linaro.org> References: <20190523150803.31504-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::943 Subject: [Qemu-devel] [PATCH 6/6] target/rx: Dump bytes for each insn during disassembly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ysato@users.sourceforge.jp Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There are so many different forms of each RX instruction that it will be very useful to be able to look at the bytes to see on which path a bug may lie. Signed-off-by: Richard Henderson --- target/rx/disas.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Yoshinori Sato diff --git a/target/rx/disas.c b/target/rx/disas.c index 5a32a87534..d73b53db44 100644 --- a/target/rx/disas.c +++ b/target/rx/disas.c @@ -102,7 +102,21 @@ static int bdsp_s(DisasContext *ctx, int d) /* Include the auto-generated decoder. */ #include "decode.inc.c" -#define prt(...) (ctx->dis->fprintf_func)((ctx->dis->stream), __VA_ARGS__) +static void dump_bytes(DisasContext *ctx) +{ + int i, len = ctx->len; + + for (i = 0; i < len; ++i) { + ctx->dis->fprintf_func(ctx->dis->stream, "%02x ", ctx->bytes[i]); + } + ctx->dis->fprintf_func(ctx->dis->stream, "%*c", (8 - i) * 3, '\t'); +} + +#define prt(...) \ + do { \ + dump_bytes(ctx); \ + ctx->dis->fprintf_func(ctx->dis->stream, __VA_ARGS__); \ + } while (0) #define RX_MEMORY_BYTE 0 #define RX_MEMORY_WORD 1