llvmpipe: Allow to dump the disassembly byte code.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 18 Aug 2009 09:28:37 +0000 (10:28 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 29 Aug 2009 08:21:33 +0000 (09:21 +0100)
Useful as dis86 doesn't disassemble some SSE4 opcodes yet.

src/gallium/drivers/llvmpipe/lp_bld_debug.c

index 49a6065a8cd1bdf42c21fcc323c41271b2c68349..f8da1c9f8e73dc694531a4ea282ca1684f4a8146 100644 (file)
@@ -53,16 +53,18 @@ lp_disassemble(const void* func)
 
    while (ud_disassemble(&ud_obj)) {
 #ifdef PIPE_ARCH_X86
-      debug_printf("%08lx:\t%s\n",
-                   (unsigned long)ud_insn_off(&ud_obj),
-                   ud_insn_asm(&ud_obj));
+      debug_printf("%08lx: ", (unsigned long)ud_insn_off(&ud_obj));
 #endif
 #ifdef PIPE_ARCH_X86_64
-   debug_printf("%016llx:\t%s\n",
-                (unsigned long long)ud_insn_off(&ud_obj),
-                ud_insn_asm(&ud_obj));
+      debug_printf("%016llx: ", (unsigned long long)ud_insn_off(&ud_obj));
 #endif
 
+#if 0
+      debug_printf("%-16s ", ud_insn_hex(&ud_obj));
+#endif
+
+      debug_printf("%s\n", ud_insn_asm(&ud_obj));
+
       if (ud_obj.mnemonic == UD_Iret)
          break;
    }