• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

コミットメタ情報

リビジョン4084282d838d3906d3fb500b4381bc5eb245acd2 (tree)
日時2020-02-24 23:09:50
作者Richard Henderson <richard.henderson@lina...>
コミッター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>

変更サマリ

差分

--- 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