diff --git a/make/Hsdis.gmk b/make/Hsdis.gmk index 469cc488f16..76695fc8dde 100644 --- a/make/Hsdis.gmk +++ b/make/Hsdis.gmk @@ -44,6 +44,9 @@ ifeq ($(HSDIS_BACKEND), capstone) else ifeq ($(call isTargetCpuArch, aarch64), true) CAPSTONE_ARCH := CS_ARCH_$(CAPSTONE_ARCH_AARCH64_NAME) CAPSTONE_MODE := CS_MODE_ARM + else ifeq ($(call isTargetCpuArch, arm), true) + CAPSTONE_ARCH := CS_ARCH_ARM + CAPSTONE_MODE := CS_MODE_ARM else $(error No support for Capstone on this platform) endif diff --git a/src/utils/hsdis/capstone/hsdis-capstone.c b/src/utils/hsdis/capstone/hsdis-capstone.c index d8a8719778d..7a17d150f40 100644 --- a/src/utils/hsdis/capstone/hsdis-capstone.c +++ b/src/utils/hsdis/capstone/hsdis-capstone.c @@ -58,6 +58,7 @@ and that causes invalid macro expansion. */ #undef aarch64 +#undef arm #include #include "hsdis.h" @@ -163,9 +164,9 @@ void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va, size_t count = cs_disasm(cs_handle, buffer, length, (uintptr_t) buffer, 0 , &insn); if (count) { for (unsigned int j = 0; j < count; j++) { - (*event_callback)(event_stream, "insn", (void*) insn[j].address); + (*event_callback)(event_stream, "insn", (void*)(uintptr_t) insn[j].address); print("%s\t\t%s", insn[j].mnemonic, insn[j].op_str); - (*event_callback)(event_stream, "/insn", (void*) (insn[j].address + insn[j].size)); + (*event_callback)(event_stream, "/insn", (void*)(uintptr_t) (insn[j].address + insn[j].size)); if (newline) { /* follow each complete insn by a nice newline */ print("\n");