Commit fa15e030bfd9dfa00530ed1a0d5d9d315a5a591a

Authored by bellard
1 parent 1ef38687

64 bit disas fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1260 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 7 additions and 9 deletions
... ... @@ -148,11 +148,7 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
148 148 #endif
149 149  
150 150 for (pc = code; pc < code + size; pc += count) {
151   -#if TARGET_LONG_BITS == 64
152   - fprintf(out, "0x%016llx: ", pc);
153   -#else
154   - fprintf(out, "0x%08x: ", pc);
155   -#endif
  151 + fprintf(out, "0x" TARGET_FMT_lx ": ", pc);
156 152 count = print_insn(pc, &disasm_info);
157 153 #if 0
158 154 {
... ... @@ -301,10 +297,12 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags)
301 297 disasm_info.endian = BFD_ENDIAN_LITTLE;
302 298 #endif
303 299 #if defined(TARGET_I386)
304   - if (!flags)
305   - disasm_info.mach = bfd_mach_i386_i386;
306   - else
  300 + if (flags == 2)
  301 + disasm_info.mach = bfd_mach_x86_64;
  302 + else if (flags == 1)
307 303 disasm_info.mach = bfd_mach_i386_i8086;
  304 + else
  305 + disasm_info.mach = bfd_mach_i386_i386;
308 306 print_insn = print_insn_i386;
309 307 #elif defined(TARGET_ARM)
310 308 print_insn = print_insn_arm;
... ... @@ -318,7 +316,7 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags)
318 316 #endif
319 317  
320 318 for(i = 0; i < nb_insn; i++) {
321   - term_printf("0x%08lx: ", (unsigned long)pc);
  319 + term_printf("0x" TARGET_FMT_lx ": ", pc);
322 320 count = print_insn(pc, &disasm_info);
323 321 term_printf("\n");
324 322 if (count < 0)
... ...