Mesa (master): llvmpipe: Tweak disassembly to match gdb.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sat Dec 5 00:54:29 PST 2009


Module: Mesa
Branch: master
Commit: 501989bbcd159f8b44148a22151bb46c4800d298
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=501989bbcd159f8b44148a22151bb46c4800d298

Author: José Fonseca <jfonseca at vmware.com>
Date:   Sat Dec  5 05:43:53 2009 +0000

llvmpipe: Tweak disassembly to match gdb.

Helps verifying udis86 output.

---

 src/gallium/drivers/llvmpipe/lp_bld_debug.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_bld_debug.c b/src/gallium/drivers/llvmpipe/lp_bld_debug.c
index 354b3af..39dfc51 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_debug.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_debug.c
@@ -77,10 +77,10 @@ lp_disassemble(const void* func)
    while (ud_disassemble(&ud_obj)) {
 
 #ifdef PIPE_ARCH_X86
-      debug_printf("%08lx: ", (unsigned long)ud_insn_off(&ud_obj));
+      debug_printf("0x%08lx:\t", (unsigned long)ud_insn_off(&ud_obj));
 #endif
 #ifdef PIPE_ARCH_X86_64
-      debug_printf("%016llx: ", (unsigned long long)ud_insn_off(&ud_obj));
+      debug_printf("0x%016llx:\t", (unsigned long long)ud_insn_off(&ud_obj));
 #endif
 
 #if 0
@@ -119,6 +119,12 @@ lp_disassemble(const void* func)
            ud_obj.mnemonic == UD_Iinvalid)
          break;
    }
+
+#if 0
+   /* Print GDB command, useful to verify udis86 output */
+   debug_printf("disassemble %p %p\n", func, (void*)(uintptr_t)ud_obj.pc);
+#endif
+
    debug_printf("\n");
 #else
    (void)func;



More information about the mesa-commit mailing list