mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-05-12 07:02:15 +00:00
translate-all: define and use DEBUG_TB_FLUSH_GATE
This gets rid of some ifdef checks while ensuring that the debug code is compiled, which prevents bit rot. Backports commit 424079c13b692cfcd08866bc9ffec77b887fed4e from qemu
This commit is contained in:
parent
b4a7d8b773
commit
79f53cf97b
|
@ -66,6 +66,12 @@
|
||||||
/* make various TB consistency checks */
|
/* make various TB consistency checks */
|
||||||
/* #define DEBUG_TB_CHECK */
|
/* #define DEBUG_TB_CHECK */
|
||||||
|
|
||||||
|
#ifdef DEBUG_TB_FLUSH
|
||||||
|
#define DEBUG_TB_FLUSH_GATE 1
|
||||||
|
#else
|
||||||
|
#define DEBUG_TB_FLUSH_GATE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
/* TB consistency checks only implemented for usermode emulation. */
|
/* TB consistency checks only implemented for usermode emulation. */
|
||||||
#undef DEBUG_TB_CHECK
|
#undef DEBUG_TB_CHECK
|
||||||
|
@ -935,13 +941,13 @@ void tb_flush(CPUState *cpu)
|
||||||
struct uc_struct* uc = cpu->uc;
|
struct uc_struct* uc = cpu->uc;
|
||||||
TCGContext *tcg_ctx = uc->tcg_ctx;
|
TCGContext *tcg_ctx = uc->tcg_ctx;
|
||||||
|
|
||||||
#if defined(DEBUG_TB_FLUSH)
|
if (DEBUG_TB_FLUSH_GATE) {
|
||||||
printf("qemu: flush code_size=%ld nb_tbs=%d avg_tb_size=%ld\n",
|
printf("qemu: flush code_size=%td nb_tbs=%d avg_tb_size=%td\n",
|
||||||
(unsigned long)(tcg_ctx->code_gen_ptr - tcg_ctx->code_gen_buffer),
|
tcg_ctx->code_gen_ptr - tcg_ctx->code_gen_buffer,
|
||||||
tcg_ctx->tb_ctx.nb_tbs, tcg_ctx->tb_ctx.nb_tbs > 0 ?
|
tcg_ctx->tb_ctx.nb_tbs, tcg_ctx->tb_ctx.nb_tbs > 0 ?
|
||||||
((unsigned long)(tcg_ctx->code_gen_ptr - tcg_ctx->code_gen_buffer)) /
|
(tcg_ctx->code_gen_ptr - tcg_ctx->code_gen_buffer) /
|
||||||
tcg_ctx->tb_ctx.nb_tbs : 0);
|
tcg_ctx->tb_ctx.nb_tbs : 0);
|
||||||
#endif
|
}
|
||||||
if ((unsigned long)((char*)tcg_ctx->code_gen_ptr - (char*)tcg_ctx->code_gen_buffer)
|
if ((unsigned long)((char*)tcg_ctx->code_gen_ptr - (char*)tcg_ctx->code_gen_buffer)
|
||||||
> tcg_ctx->code_gen_buffer_size) {
|
> tcg_ctx->code_gen_buffer_size) {
|
||||||
cpu_abort(cpu, "Internal error: code buffer overflow\n");
|
cpu_abort(cpu, "Internal error: code buffer overflow\n");
|
||||||
|
|
Loading…
Reference in a new issue