Search
lxdream.org :: lxdream/src/sh4/sh4trans.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4trans.c
changeset 1094:d2324eb67223
prev1091:186558374345
next1103:de9ad2c0cf56
author nkeynes
date Mon Dec 21 08:23:54 2009 +1000 (10 years ago)
permissions -rw-r--r--
last change Fix symbol output in 64-bit disassembly
Add sh4_translate_dump_block(pc) function
file annotate diff log raw
1.1 --- a/src/sh4/sh4trans.c Tue Dec 15 08:46:37 2009 +1000
1.2 +++ b/src/sh4/sh4trans.c Mon Dec 21 08:23:54 2009 +1000
1.3 @@ -274,3 +274,24 @@
1.4 void *native_pc = xlat_get_native_pc( code, xlat_get_code_size(code) );
1.5 sh4_translate_disasm_block( stderr, code, sh4r.pc, native_pc );
1.6 }
1.7 +
1.8 +/**
1.9 + * Dual-dump the translated block and original SH4 code for the basic block
1.10 + * starting at sh4_pc. If there is no translated block, this prints an error
1.11 + * and returns.
1.12 + */
1.13 +void sh4_translate_dump_block( uint32_t sh4_pc )
1.14 +{
1.15 + if( !IS_IN_ICACHE(sh4_pc) ) {
1.16 + fprintf( stderr, "** Address %08x not in current instruction region **\n", sh4_pc );
1.17 + return;
1.18 + }
1.19 + uint32_t pma = GET_ICACHE_PHYS(sh4_pc);
1.20 + void *code = xlat_get_code( pma );
1.21 + if( code == NULL ) {
1.22 + fprintf( stderr, "** No translated block for address %08x **\n", sh4_pc );
1.23 + return;
1.24 + }
1.25 + sh4_translate_disasm_block( stderr, code, sh4_pc, NULL );
1.26 +}
1.27 +
.