<html>
<body>
<div id="body" style="background-color:#ffffff;" >
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head" style="border-bottom-width:1px;border-bottom-style:solid;" ><td class="headtd" style="padding:0;padding-top:.2em;" colspan="4">Commit in <b><tt>lxdream/src</tt></b></td></tr>
<tr><td><tt>sh4/<a href="#file1">sh4.h</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+3</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">34faf227070e -> d2324eb67223</td></tr>
<tr class="alt" style=";" ><td><tt> /<a href="#file2">sh4trans.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+21</td><td></td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">34faf227070e -> d2324eb67223</td></tr>
<tr><td><tt>x86dasm/<a href="#file3">i386-dis.c</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+10</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-71</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">34faf227070e -> d2324eb67223</td></tr>
<tr class="alt" style=";" ><td><tt> /<a href="#file4">x86dasm.c</a></tt></td><td id="addedalt" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ccf7cc;" align="right">+1</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">34faf227070e -> d2324eb67223</td></tr>
<tr><td><tt> /<a href="#file5">x86dasm.h</a></tt></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+1</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-1</td><td class="headtd2" style="padding-left:.3em;padding-right:.3em;" nowrap="nowrap">34faf227070e -> d2324eb67223</td></tr>
<tr><td></td><td id="added" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ddffdd;" align="right">+36</td><td id="removed" class="headtd2" style="padding-left:.3em;padding-right:.3em; background-color:#ffdddd;" align="right">-73</td><td></td></tr>
</table>
<small id="info" style="color: #888888;" >5 modified files</small><br />
<pre class="comment" style="white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd;" >
Fix symbol output in 64-bit disassembly
Add sh4_translate_dump_block(pc) function
</pre>
<hr /><a name="file1" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/sh4</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>sh4.h</b></big> <small id="info" style="color: #888888;" >34faf227070e -> d2324eb67223</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/sh4/sh4.h
+++ lxdream/src/sh4/sh4.h
@@ -131,6 +131,9 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > /** Dump current SH4 core state (for crashdump purposes) */
void sh4_crashdump();
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+/** Dump a translated block with SH4 and target assembly side by side. */
+void sh4_translate_dump_block( uint32_t pc );
+
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > #ifdef __cplusplus
}
#endif
</pre></div>
<hr /><a name="file2" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/sh4</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>sh4trans.c</b></big> <small id="info" style="color: #888888;" >34faf227070e -> d2324eb67223</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/sh4/sh4trans.c
+++ lxdream/src/sh4/sh4trans.c
@@ -274,3 +274,24 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > void *native_pc = xlat_get_native_pc( code, xlat_get_code_size(code) );
sh4_translate_disasm_block( stderr, code, sh4r.pc, native_pc );
}
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+
+/**
+ * Dual-dump the translated block and original SH4 code for the basic block
+ * starting at sh4_pc. If there is no translated block, this prints an error
+ * and returns.
+ */
+void sh4_translate_dump_block( uint32_t sh4_pc )
+{
+ if( !IS_IN_ICACHE(sh4_pc) ) {
+ fprintf( stderr, "** Address %08x not in current instruction region **\n", sh4_pc );
+ return;
+ }
+ uint32_t pma = GET_ICACHE_PHYS(sh4_pc);
+ void *code = xlat_get_code( pma );
+ if( code == NULL ) {
+ fprintf( stderr, "** No translated block for address %08x **\n", sh4_pc );
+ return;
+ }
+ sh4_translate_disasm_block( stderr, code, sh4_pc, NULL );
+}
+
</pre></div>
<hr /><a name="file3" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/x86dasm</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>i386-dis.c</b></big> <small id="info" style="color: #888888;" >34faf227070e -> d2324eb67223</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/x86dasm/i386-dis.c
+++ lxdream/src/x86dasm/i386-dis.c
@@ -57,7 +57,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > static void oappend (const char *);
static void append_seg (void);
static void OP_indirE (int, int);
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-static void print_operand_value (char *, int, bfd_vma);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > static void OP_E (int, int);
static void OP_G (int, int);
static bfd_vma get64 (void);
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3058,66 +3057,6 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
static void
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-print_operand_value (char *buf, int hex, bfd_vma disp)
-{
- if (mode_64bit)
- {
- if (hex)
- {
- char tmp[30];
- int i;
- buf[0] = '0';
- buf[1] = 'x';
- sprintf_vma (tmp, disp);
- for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
- strcpy (buf + 2, tmp + i);
- }
- else
- {
- bfd_signed_vma v = disp;
- char tmp[30];
- int i;
- if (v < 0)
- {
- *(buf++) = '-';
- v = -disp;
- /* Check for possible overflow on 0x8000000000000000. */
- if (v < 0)
- {
- strcpy (buf, "9223372036854775808");
- return;
- }
- }
- if (!v)
- {
- strcpy (buf, "0");
- return;
- }
-
- i = 0;
- tmp[29] = 0;
- while (v)
- {
- tmp[28 - i] = (v % 10) + '0';
- v /= 10;
- i++;
- }
- strcpy (buf, tmp + 29 - i);
- }
- }
- else
- {
- x86_print_symbolic_operand( buf, hex, disp );
- /*
- if (hex)
- sprintf (buf, "0x%x", (unsigned int) disp);
- else
- sprintf (buf, "%d", (int) disp);
- */
- }
-}
-
-static void
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > OP_E (int bytemode, int sizeflag)
{
bfd_vma disp;
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3236,7 +3175,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > if (!intel_syntax)
if (mod != 0 || (base & 7) == 5)
{
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf, !riprel, disp);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf, !riprel, disp);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf);
if (riprel)
{
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3342,7 +3281,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > *obufp = '\0';
}
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf, 0, disp);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf, 0, disp);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf);
}
}
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3362,7 +3301,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (names_seg[ds_reg - es_reg]);
oappend (":");
}
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf, 1, disp);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf, 1, disp);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf);
}
}
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3395,7 +3334,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > if (!intel_syntax)
if (mod != 0 || (rm & 7) == 6)
{
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf, 0, disp);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf, 0, disp);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf);
}
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3693,7 +3632,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >
op &= mask;
scratchbuf[0] = '$';
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf + 1, 1, op);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf + 1, 1, op);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf + intel_syntax);
scratchbuf[0] = '\0';
}
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3744,7 +3683,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" >
op &= mask;
scratchbuf[0] = '$';
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf + 1, 1, op);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf + 1, 1, op);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf + intel_syntax);
scratchbuf[0] = '\0';
}
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3794,7 +3733,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
scratchbuf[0] = '$';
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf + 1, 1, op);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf + 1, 1, op);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf + intel_syntax);
}
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3830,7 +3769,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
disp = (start_pc + codep - start_codep + disp) & mask;
set_op (disp, 0);
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf, 1, disp);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf, 1, disp);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf);
}
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3884,7 +3823,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (":");
}
}
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf, 1, off);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf, 1, off);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf);
}
</pre><pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >@@ -3912,7 +3851,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (":");
}
}
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >- print_operand_value (scratchbuf, 1, off);
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+ x86_print_symbolic_operand (scratchbuf, 1, off);
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > oappend (scratchbuf);
}
</pre></div>
<hr /><a name="file4" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/x86dasm</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>x86dasm.c</b></big> <small id="info" style="color: #888888;" >34faf227070e -> d2324eb67223</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/x86dasm/x86dasm.c
+++ lxdream/src/x86dasm/x86dasm.c
@@ -105,7 +105,7 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > }
}
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-void x86_print_symbolic_operand( char *buf, int hex, u<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >nsigned in</span>t disp )
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void x86_print_symbolic_operand( char *buf, int hex, u<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >intptr_</span>t disp )
</pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > {
const char *sym = x86_find_symbol(disp, NULL);
if( sym != NULL ) {
</pre></div>
<hr /><a name="file5" /><div class="file" style="border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;" >
<span class="pathname" style="font-family:monospace; float:right;" >lxdream/src/x86dasm</span><br />
<div class="fileheader" style="margin-bottom:.5em;" ><big><b>x86dasm.h</b></big> <small id="info" style="color: #888888;" >34faf227070e -> d2324eb67223</small></div>
<pre class="diff" style="margin:0;" ><small id="info" style="color: #888888;" >--- lxdream/src/x86dasm/x86dasm.h
+++ lxdream/src/x86dasm/x86dasm.h
@@ -31,4 +31,4 @@
</small></pre><pre id="context" class="diff" style="margin:0; background-color:#eeeeee;" > void x86_set_symtab( x86_symbol *symtab, int num_symbols );
void x86_disasm_init();
uintptr_t x86_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode );
</pre><pre id="removed" class="diff" style="margin:0; background-color:#ffdddd;" >-void x86_print_symbolic_operand( char *buf, int hex, u<span id="removedchars" style="background-color:#ff9999;font-weight:bolder;" >nsigned in</span>t disp );
</pre><pre id="added" class="diff" style="margin:0; background-color:#ddffdd;" >+void x86_print_symbolic_operand( char *buf, int hex, u<span id="addedchars" style="background-color:#99ff99;font-weight:bolder;" >intptr_</span>t disp );
</pre></div>
<center><small>Chaos Theory</small></center>
</div></body></html>