revision 920:1e6a29649b56
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 920:1e6a29649b56 |
parent | 919:dfa21f43925b |
child | 921:6c0e9a8f5618 |
author | nkeynes |
date | Thu Dec 04 09:06:35 2008 +0000 (15 years ago) |
Update to print symbols for matching operands
1.1 --- a/src/x86dasm/i386-dis.c Thu Dec 04 09:05:56 2008 +00001.2 +++ b/src/x86dasm/i386-dis.c Thu Dec 04 09:06:35 2008 +00001.3 @@ -3106,10 +3106,13 @@1.4 }1.5 else1.6 {1.7 + x86_print_symbolic_operand( buf, hex, disp );1.8 + /*1.9 if (hex)1.10 sprintf (buf, "0x%x", (unsigned int) disp);1.11 else1.12 sprintf (buf, "%d", (int) disp);1.13 + */1.14 }1.15 }
2.1 --- a/src/x86dasm/x86dasm.c Thu Dec 04 09:05:56 2008 +00002.2 +++ b/src/x86dasm/x86dasm.c Thu Dec 04 09:06:35 2008 +00002.3 @@ -104,6 +104,18 @@2.4 }2.5 }2.7 +void x86_print_symbolic_operand( char *buf, int hex, unsigned int disp )2.8 +{2.9 + const char *sym = x86_find_symbol(disp, NULL);2.10 + if( sym != NULL ) {2.11 + snprintf( buf, 50, "<%s>", sym );2.12 + } else if( hex ) {2.13 + sprintf( buf, "0x%x", disp );2.14 + } else {2.15 + sprintf( buf, "%d", (int)disp );2.16 + }2.17 +}2.18 +2.19 uint32_t x86_disasm_instruction( uintptr_t pc, char *buf, int len, char *opcode )2.20 {2.21 int count, i;
.