Commit e43917cc authored by Richard Henderson's avatar Richard Henderson Committed by Philippe Mathieu-Daudé
Browse files

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: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: default avatarYoshinori Sato <ysato@users.sourceforge.jp>
Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-Id: <20190531134315.4109-24-richard.henderson@linaro.org>
Acked-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
parent 05a8599f
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -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