From: Aleksey Demakov Date: Fri, 1 Jul 2011 20:00:31 +0000 (+0700) Subject: amend debug info in compile_block() X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=4a4a71232da86da63591b06a99c9505e6c533b19;p=francis%2Flibjit.git amend debug info in compile_block() --- diff --git a/ChangeLog b/ChangeLog index a1440c7..2d085f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-02 Aleksey Demakov + + * jit/jit-compile.c (compile_block): amend debug info + 2010-11-28 Klaus Treichel * config/jit-opcodes.ops: Set the destination value type for the diff --git a/jit/jit-compile.c b/jit/jit-compile.c index 8910912..9246172 100644 --- a/jit/jit-compile.c +++ b/jit/jit-compile.c @@ -26,6 +26,7 @@ #include "jit-reg-alloc.h" #include "jit-setjmp.h" #ifdef _JIT_COMPILE_DEBUG +# include # include #endif @@ -161,7 +162,7 @@ compile_block(jit_gencode_t gen, jit_function_t func, jit_block_t block) jit_insn_t insn; #ifdef _JIT_COMPILE_DEBUG - printf("Block #%d: %d\n", func->builder->block_count++, block->label); + printf("Block #%d: %d\n\n", func->builder->block_count++, block->label); #endif /* Iterate over all blocks in the function */ @@ -171,8 +172,9 @@ compile_block(jit_gencode_t gen, jit_function_t func, jit_block_t block) #ifdef _JIT_COMPILE_DEBUG unsigned char *p1, *p2; p1 = gen->posn.ptr; - printf("Insn: %5d, Opcode: 0x%04x\n", func->builder->insn_count++, insn->opcode); - printf("Start of binary code: 0x%08x\n", p1); + printf("Insn #%d: ", func->builder->insn_count++); + jit_dump_insn(stdout, func, insn); + printf("\nStart of binary code: 0x%08x\n", p1); #endif switch(insn->opcode)