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,11 +148,7 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
148 #endif 148 #endif
149 149
150 for (pc = code; pc < code + size; pc += count) { 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 count = print_insn(pc, &disasm_info); 152 count = print_insn(pc, &disasm_info);
157 #if 0 153 #if 0
158 { 154 {
@@ -301,10 +297,12 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags) @@ -301,10 +297,12 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags)
301 disasm_info.endian = BFD_ENDIAN_LITTLE; 297 disasm_info.endian = BFD_ENDIAN_LITTLE;
302 #endif 298 #endif
303 #if defined(TARGET_I386) 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 disasm_info.mach = bfd_mach_i386_i8086; 303 disasm_info.mach = bfd_mach_i386_i8086;
  304 + else
  305 + disasm_info.mach = bfd_mach_i386_i386;
308 print_insn = print_insn_i386; 306 print_insn = print_insn_i386;
309 #elif defined(TARGET_ARM) 307 #elif defined(TARGET_ARM)
310 print_insn = print_insn_arm; 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,7 +316,7 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags)
318 #endif 316 #endif
319 317
320 for(i = 0; i < nb_insn; i++) { 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 count = print_insn(pc, &disasm_info); 320 count = print_insn(pc, &disasm_info);
323 term_printf("\n"); 321 term_printf("\n");
324 if (count < 0) 322 if (count < 0)