diff options
author | Brian Paul <brianp@vmware.com> | 2010-10-14 16:21:32 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-10-14 17:28:24 -0600 |
commit | 62450b3c490e3f16aa18135d5b1767911861ae4a (patch) | |
tree | 2e08f47f71d0f43004cdc7a9537fa06708a4dbdb /src/gallium/auxiliary/gallivm/lp_bld_debug.c | |
parent | 8fb49554d9404cd3538f569003a0f917fbdfb2d8 (diff) |
gallivm: add compile-time option to emit inst addrs and/or line numbers
Disabling address printing is helpful for diffing.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_debug.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_debug.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.c b/src/gallium/auxiliary/gallivm/lp_bld_debug.c index 8c1df0d8e3..93e56553d7 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.c @@ -57,6 +57,8 @@ lp_disassemble(const void* func) #ifdef HAVE_UDIS86 ud_t ud_obj; uint64_t max_jmp_pc; + uint inst_no; + boolean emit_addrs = TRUE, emit_line_nos = FALSE; ud_init(&ud_obj); @@ -76,13 +78,18 @@ lp_disassemble(const void* func) while (ud_disassemble(&ud_obj)) { + if (emit_addrs) { #ifdef PIPE_ARCH_X86 - debug_printf("0x%08lx:\t", (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("0x%016llx:\t", (unsigned long long)ud_insn_off(&ud_obj)); + debug_printf("0x%016llx:\t", (unsigned long long)ud_insn_off(&ud_obj)); #endif - + } + else if (emit_line_nos) { + debug_printf("%6d:\t", inst_no); + inst_no++; + } #if 0 debug_printf("%-16s ", ud_insn_hex(&ud_obj)); #endif |