• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版f4d8aeb7d89cd41cdac358c3e3bb3b75158676ee (tree)
时间2020-01-23 21:44:25
作者Richard Henderson <richard.henderson@lina...>
CommiterYoshinori Sato

Log Message

target/rx: Dump bytes for each insn during disassembly

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: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Message-Id: <20190607091116.49044-24-ysato@users.sourceforge.jp>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

更改概述

差异

--- a/target/rx/disas.c
+++ b/target/rx/disas.c
@@ -102,7 +102,21 @@ static int bdsp_s(DisasContext *ctx, int d)
102102 /* Include the auto-generated decoder. */
103103 #include "decode.inc.c"
104104
105-#define prt(...) (ctx->dis->fprintf_func)((ctx->dis->stream), __VA_ARGS__)
105+static void dump_bytes(DisasContext *ctx)
106+{
107+ int i, len = ctx->len;
108+
109+ for (i = 0; i < len; ++i) {
110+ ctx->dis->fprintf_func(ctx->dis->stream, "%02x ", ctx->bytes[i]);
111+ }
112+ ctx->dis->fprintf_func(ctx->dis->stream, "%*c", (8 - i) * 3, '\t');
113+}
114+
115+#define prt(...) \
116+ do { \
117+ dump_bytes(ctx); \
118+ ctx->dis->fprintf_func(ctx->dis->stream, __VA_ARGS__); \
119+ } while (0)
106120
107121 #define RX_MEMORY_BYTE 0
108122 #define RX_MEMORY_WORD 1