From 9fbf8080fb308d9c6dad8c534ad8892c2d715087 Mon Sep 17 00:00:00 2001 From: comex Date: Wed, 21 Jan 2015 17:02:52 -0500 Subject: minor cleanup - stop caring about thumb outside of arch-specific code (and fix makefile bug where files whose names contained 'arm' would always be ldid'd) --- test/test-jump-dis.c | 7 ++++++- test/test-transform-dis.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/test-jump-dis.c b/test/test-jump-dis.c index 1a34bc0..ef6add8 100644 --- a/test/test-jump-dis.c +++ b/test/test-jump-dis.c @@ -7,7 +7,12 @@ int main(UNUSED int argc, char **argv) { UNUSED size_t size = fread(buf, 1, sizeof(buf), stdin); printf("size=%zd\n", size); int patch_size = atoi(argv[1]); + struct arch_dis_ctx arch; + memset(&arch, 0, sizeof(arch)); +#ifdef __arm__ int thumb = atoi(argv[2]); - bool bad = P(main)(buf, 0x10000, 0x10000 + patch_size, thumb); + arch.pc_low_bit = thumb; +#endif + bool bad = P(main)(buf, 0x10000, 0x10000 + patch_size, arch); printf("final: bad = %d\n", bad); } diff --git a/test/test-transform-dis.c b/test/test-transform-dis.c index d7c44d6..a0a60d5 100644 --- a/test/test-transform-dis.c +++ b/test/test-transform-dis.c @@ -6,7 +6,12 @@ int main(UNUSED int argc, char **argv) { static uint8_t in[1048576]; UNUSED size_t size = fread(in, 1, sizeof(in), stdin); int patch_size = atoi(argv[1]); + struct arch_dis_ctx arch; + memset(&arch, 0, sizeof(arch)); +#ifdef __arm__ int thumb = atoi(argv[2]); + arch.pc_low_bit = thumb; +#endif uint8_t out[patch_size * 10]; int offsets[patch_size + 1]; void *rewritten_ptr = out; @@ -16,7 +21,7 @@ int main(UNUSED int argc, char **argv) { &rewritten_ptr, 0x10000, 0x10000 + patch_size, - thumb, + arch, offsets); printf("=> %d\n", ret); printf("#endif\n"); -- cgit v1.2.3