Revisão | f4d8aeb7d89cd41cdac358c3e3bb3b75158676ee (tree) |
---|---|
Hora | 2020-01-23 21:44:25 |
Autor | Richard Henderson <richard.henderson@lina...> |
Commiter | Yoshinori Sato |
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>
@@ -102,7 +102,21 @@ static int bdsp_s(DisasContext *ctx, int d) | ||
102 | 102 | /* Include the auto-generated decoder. */ |
103 | 103 | #include "decode.inc.c" |
104 | 104 | |
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) | |
106 | 120 | |
107 | 121 | #define RX_MEMORY_BYTE 0 |
108 | 122 | #define RX_MEMORY_WORD 1 |