Search
lxdream.org :: lxdream/src/test/testsh4x86.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/test/testsh4x86.c
changeset 1263:b3de98d19faf
prev1189:1540105786c8
next1302:765e514f99a6
author nkeynes
date Tue Mar 06 09:04:34 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Break host disassembly bits out of sh4x86.in, and move the generic disasm
bits from x86dasm to xlat.
file annotate diff log raw
1.1 --- a/src/test/testsh4x86.c Thu Dec 01 08:02:13 2011 +1000
1.2 +++ b/src/test/testsh4x86.c Tue Mar 06 09:04:34 2012 +1000
1.3 @@ -24,7 +24,7 @@
1.4 #include <sys/stat.h>
1.5 #include <string.h>
1.6
1.7 -#include "x86dasm/x86dasm.h"
1.8 +#include "xlat/xlatdasm.h"
1.9 #include "sh4/sh4trans.h"
1.10 #include "sh4/sh4core.h"
1.11 #include "sh4/sh4mmio.h"
1.12 @@ -35,6 +35,7 @@
1.13 struct mmio_region mmio_region_PMM;
1.14 struct breakpoint_struct sh4_breakpoints[MAX_BREAKPOINTS];
1.15 int sh4_breakpoint_count = 0;
1.16 +gboolean sh4_profile_blocks = FALSE;
1.17
1.18 #define MAX_INS_SIZE 32
1.19
1.20 @@ -56,7 +57,7 @@
1.21
1.22 char *inbuf;
1.23
1.24 -struct x86_symbol local_symbols[] = {
1.25 +struct xlat_symbol local_symbols[] = {
1.26 { "sh4r+128", ((char *)&sh4r)+128 },
1.27 { "sh4_cpu_period", &sh4_cpu_period },
1.28 { "sh4_address_space", (void *)0x12345432 },
1.29 @@ -192,12 +193,11 @@
1.30 uintptr_t pc;
1.31 uint8_t *buf = sh4_translate_basic_block( start_addr );
1.32 uint32_t buflen = xlat_get_code_size(buf);
1.33 - x86_disasm_init( buf, (uintptr_t)buf, buflen );
1.34 - x86_set_symtab( local_symbols, sizeof(local_symbols)/sizeof(struct x86_symbol) );
1.35 + xlat_disasm_init( local_symbols, sizeof(local_symbols)/sizeof(struct xlat_symbol) );
1.36 for( pc = (uintptr_t)buf; pc < ((uintptr_t)buf) + buflen; ) {
1.37 char buf[256];
1.38 char op[256];
1.39 - uintptr_t pc2 = x86_disasm_instruction( pc, buf, sizeof(buf), op );
1.40 + uintptr_t pc2 = xlat_disasm_instruction( pc, buf, sizeof(buf), op );
1.41 fprintf( stdout, "%p: %s\n", (void *)pc, buf );
1.42 pc = pc2;
1.43 }
.