From 3000ca6abff85d763292cfb1c7b53d911163a035 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Fri, 22 Jan 2016 11:33:28 +0800 Subject: [PATCH] arm64: fix the access to tcg_op_defs[] in arm64 backend (issue #387) --- qemu/tcg/aarch64/tcg-target.c | 2 +- tests/unit/test_tb_x86.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/qemu/tcg/aarch64/tcg-target.c b/qemu/tcg/aarch64/tcg-target.c index 6dff1756..ce8360f6 100644 --- a/qemu/tcg/aarch64/tcg-target.c +++ b/qemu/tcg/aarch64/tcg-target.c @@ -1241,7 +1241,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, { /* 99% of the time, we can signal the use of extension registers by looking to see if the opcode handles 64-bit data. */ - TCGType ext = (tcg_op_defs[opc].flags & TCG_OPF_64BIT) != 0; + TCGType ext = (s->tcg_op_defs[opc].flags & TCG_OPF_64BIT) != 0; /* Hoist the loads of the most common arguments. */ TCGArg a0 = args[0]; diff --git a/tests/unit/test_tb_x86.c b/tests/unit/test_tb_x86.c index 7b51d71a..2edfb270 100644 --- a/tests/unit/test_tb_x86.c +++ b/tests/unit/test_tb_x86.c @@ -201,9 +201,14 @@ static void hook_mem32(uc_engine *uc, //uint32_t tmp[1]; ctype = '?'; - if (type == 16) ctype = 'R'; - if (type == 17) ctype = 'W'; - printf("hook_mem32(%c): Address: 0x%"PRIx64", Size: %d, Value:0x%"PRIx64"\n", ctype, address, size, value); + if (type == UC_MEM_READ) { + ctype = 'R'; + printf("hook_mem32(%c): Address: 0x%"PRIx64", Size: %d \n", ctype, address, size); + } + if (type == UC_MEM_WRITE) { + ctype = 'W'; + printf("hook_mem32(%c): Address: 0x%"PRIx64", Size: %d, Value:0x%"PRIx64"\n", ctype, address, size, value); + } // if (!uc_mem_read(uc, 0x6000003a, tmp, 4)) // {