From patchwork Fri May 31 13:43:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 165539 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp796876ili; Fri, 31 May 2019 07:04:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqy8Qu7n5nh/YdXPmIQVuYmF3vyPDrYy1EWbgnQYGpfeTBsHV732aDcpzDjAxBrKiJpjDa8k X-Received: by 2002:a05:620a:1124:: with SMTP id p4mr8464943qkk.194.1559311455282; Fri, 31 May 2019 07:04:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559311455; cv=none; d=google.com; s=arc-20160816; b=v+zsx0GIICG8pvRFUGAlztg62B3qq/hqZJEesIEw9J3iiMUtFyjK+PVSUvCwZKkM0s PKm4pggq4BT/Py1vGrHWyTKvCJIKJ8USY6a70hRrYLrtSKw3NRT90MIv7E+th3DT1MBv hby142uzCWxsz+JFsA8khLtrP+Qxl/UFIXePpN2e8cEF5vn5ZPG+h9F9EOt8U4fDFbwL iowyjvTVCSzcPZJYimkXIkw38OTulj/h1ZCL3paX/y4oam/MdEmqhSvm6fq4lt8I3Z85 55MwA2rPUYk3O6F+Xa3cpFycvQZdlOuC3pLIvWNp4FWBNwkWr7lzyrkyBOlNBOZubOZz Y13Q== 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=ukF5U5/YWULrIZTRqlrGB8Y3cOFI0trhAV1LyR0c8Es=; b=AQTJX7nnpAjDXPpslMz8rYTo4f5HzcK1kDUBPzfc9kr4nHFiIR4FJRMBl9iTshtb1w cTMnwYCVosYyR+tVhr9YKjgsvcJQwBHBWbHxWtIa43X0hJNBAwzy9VkhbOKVW3ietx0C 2vkJAj+mHvCCSJOq/PPVk119bnCPxoagjFRM2KMx7sU9UeJnIHLR84jDJ8A+cnWs+aIe vq4b4Ism89TPYOTV9GPeHH+KC5Djz/jo2GrLwvtaHKKXXBVI9rCbLn0OptxZs9jrysnr HA+MXGWEQ2o9+bux87M7cHUPeDUN6g6dY9BwAr1xefgOEdGe4hC33c8FthhKqNdyNJkH J5FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lWQhEC2I; 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 m123si46164qkf.175.2019.05.31.07.04.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 31 May 2019 07:04:15 -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=lWQhEC2I; 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]:44093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWi8k-0006ZU-Tx for patch@linaro.org; Fri, 31 May 2019 10:04:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWhp3-0007ip-1G for qemu-devel@nongnu.org; Fri, 31 May 2019 09:43:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWhp1-0000je-TK for qemu-devel@nongnu.org; Fri, 31 May 2019 09:43:53 -0400 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:42182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWhp1-0000ix-OG for qemu-devel@nongnu.org; Fri, 31 May 2019 09:43:51 -0400 Received: by mail-oi1-x241.google.com with SMTP id v25so7163140oic.9 for ; Fri, 31 May 2019 06:43:51 -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=ukF5U5/YWULrIZTRqlrGB8Y3cOFI0trhAV1LyR0c8Es=; b=lWQhEC2IaAIRs7J/QGxTu6dKe0hqaytXLP4CB+uJsV1vlmK0Vns31smwNY67rYfCJ6 t4WTnRClJma1C/Nrg6hGgiHiGPj/4dOEXEfrZOC3H7JY166S6POXM4o6+cjRbHj4XbKL 4VJcFkLu4adhzLfHn3cGhH5AvKPHCrmLn6sUty8GBUtTC5QgGg2YP5u4ou5Cc7cVzHSp z/X+nWF0UlmxlwBJOSmYjzt6nHLrrma4Gq5w15xwRIYKWlTwB2Cyshaw6nI8eaJ/GkNS pYFZXEDRPB/nBsBr0oT87xH5NZotkLXig/dCABuRFaud1qq9qghJZo1NG9HD+AuMnI7Z SV8w== 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=ukF5U5/YWULrIZTRqlrGB8Y3cOFI0trhAV1LyR0c8Es=; b=Qk6kUNCRtvusxFrDLTNa5UhXKBzhma87inKlzxkjXjpV/KF5fXk8wZox/ePoV9L6T+ w9+ju97w7GjLEkADvvNJYfeJPDnC8pGM6e+WhzNwmkWFEiITZ70eNS+AsLwsjZtvIIQ2 LovAWdkL+uVuYkUB/pSPNLtfAneDoXHOCMZn0CIrxjiUuuPdAyf9MpOaD3q5ozzQv0gy RWnyC4+fE9hfRMOnS7BtnBAyRGViL+PEaIwHKlD02/PK6/YOD/bL0OdD/cqoI4p+0Qbe yZGXFUiRIameVPPrNa6eD9oAzPQ0rQCJLtr8OLtnXjw1tqSQFkK0MV2KcpawKcwxet8c lE2g== X-Gm-Message-State: APjAAAUZTJlVFbWVewFG2NMg1L7ecYPmq3/s/3I2H/07IiJJM7PiYO3I w6/JU59eDa2ZUXBy0J+ka64BGKlV7eIUsQ== X-Received: by 2002:aca:3942:: with SMTP id g63mr5265549oia.48.1559310230879; Fri, 31 May 2019 06:43:50 -0700 (PDT) Received: from localhost.localdomain (168.189-204-159.bestelclientes.com.mx. [189.204.159.168]) by smtp.gmail.com with ESMTPSA id r23sm2391176otg.49.2019.05.31.06.43.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 06:43:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 31 May 2019 08:43:15 -0500 Message-Id: <20190531134315.4109-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190531134315.4109-1-richard.henderson@linaro.org> References: <20190531134315.4109-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::241 Subject: [Qemu-devel] [PATCH v16 23/23] 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: philmd@redhat.com, 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. Reviewed-by: Yoshinori Sato Signed-off-by: Richard Henderson --- target/rx/disas.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) -- 2.17.1 Reviewed-by: Philippe Mathieu-Daudé 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