From eb93cee2a22cde812ccd6b9bd418d36185c058f5 Mon Sep 17 00:00:00 2001 From: comex Date: Sun, 8 Feb 2015 23:45:24 -0500 Subject: Refactor disassembly so x86 works, and add x86 transform-dis. This patch is a monolithic mess, because I was too lazy to do the refactor first (that would require some stash fun, since I wasn't actually sure before doing x86 transform-dis what would be needed). Anyway, the resulting code should be cleaner - less duplication. This breaks ARM/ARM64. --- lib/substitute-internal.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lib/substitute-internal.h') diff --git a/lib/substitute-internal.h b/lib/substitute-internal.h index 17ad6ec..9a91516 100644 --- a/lib/substitute-internal.h +++ b/lib/substitute-internal.h @@ -49,12 +49,22 @@ typedef struct section section_x; #endif #if defined(TARGET_arm) - #include "arm/misc.h" + #define TARGET_DIR arm #elif defined(TARGET_arm64) - #include "arm64/misc.h" + #define TARGET_DIR arm64 #elif defined(TARGET_x86_64) || defined(TARGET_i386) - #include "x86/misc.h" + #define TARGET_DIR x86 #endif +#define stringify_(x) #x +#define stringify(x) stringify_(x) +#include stringify(TARGET_DIR/misc.h) + +#if TARGET_POINTER_SIZE == 8 + typedef uint64_t uint_tptr; +#elif TARGET_POINTER_SIZE == 4 + typedef uint32_t uint_tptr; +#endif + #ifdef __APPLE__ /* This could graduate to a public API but is not yet. Needs more -- cgit v1.2.3