Diff for /qemu/disas.c between versions 1.1.1.13 and 1.1.1.14

version 1.1.1.13, 2018/04/24 19:16:51 version 1.1.1.14, 2018/04/24 19:33:56
Line 51  perror_memory (int status, bfd_vma memad Line 51  perror_memory (int status, bfd_vma memad
                            "Address 0x%" PRIx64 " is out of bounds.\n", memaddr);                             "Address 0x%" PRIx64 " is out of bounds.\n", memaddr);
 }  }
   
 /* This could be in a separate file, to save miniscule amounts of space  /* This could be in a separate file, to save minuscule amounts of space
    in statically linked executables.  */     in statically linked executables.  */
   
 /* Just print the address is hex.  This is included for completeness even  /* Just print the address is hex.  This is included for completeness even
Line 138  print_insn_thumb1(bfd_vma pc, disassembl Line 138  print_insn_thumb1(bfd_vma pc, disassembl
 /* Disassemble this for me please... (debugging). 'flags' has the following  /* Disassemble this for me please... (debugging). 'flags' has the following
    values:     values:
     i386 - 1 means 16 bit code, 2 means 64 bit code      i386 - 1 means 16 bit code, 2 means 64 bit code
     arm  - nonzero means thumb code      arm  - bit 0 = thumb, bit 1 = reverse endian
     ppc  - nonzero means little endian      ppc  - nonzero means little endian
     other targets - unused      other targets - unused
  */   */
Line 169  void target_disas(FILE *out, target_ulon Line 169  void target_disas(FILE *out, target_ulon
         disasm_info.mach = bfd_mach_i386_i386;          disasm_info.mach = bfd_mach_i386_i386;
     print_insn = print_insn_i386;      print_insn = print_insn_i386;
 #elif defined(TARGET_ARM)  #elif defined(TARGET_ARM)
     if (flags)      if (flags & 1) {
         print_insn = print_insn_thumb1;          print_insn = print_insn_thumb1;
     else      } else {
         print_insn = print_insn_arm;          print_insn = print_insn_arm;
       }
       if (flags & 2) {
   #ifdef TARGET_WORDS_BIGENDIAN
           disasm_info.endian = BFD_ENDIAN_LITTLE;
   #else
           disasm_info.endian = BFD_ENDIAN_BIG;
   #endif
       }
 #elif defined(TARGET_SPARC)  #elif defined(TARGET_SPARC)
     print_insn = print_insn_sparc;      print_insn = print_insn_sparc;
 #ifdef TARGET_SPARC64  #ifdef TARGET_SPARC64
Line 220  void target_disas(FILE *out, target_ulon Line 228  void target_disas(FILE *out, target_ulon
 #elif defined(TARGET_MICROBLAZE)  #elif defined(TARGET_MICROBLAZE)
     disasm_info.mach = bfd_arch_microblaze;      disasm_info.mach = bfd_arch_microblaze;
     print_insn = print_insn_microblaze;      print_insn = print_insn_microblaze;
   #elif defined(TARGET_LM32)
       disasm_info.mach = bfd_mach_lm32;
       print_insn = print_insn_lm32;
 #else  #else
     fprintf(out, "0x" TARGET_FMT_lx      fprintf(out, "0x" TARGET_FMT_lx
             ": Asm output not supported on this arch\n", code);              ": Asm output not supported on this arch\n", code);
Line 257  void target_disas(FILE *out, target_ulon Line 268  void target_disas(FILE *out, target_ulon
 /* Disassemble this for me please... (debugging). */  /* Disassemble this for me please... (debugging). */
 void disas(FILE *out, void *code, unsigned long size)  void disas(FILE *out, void *code, unsigned long size)
 {  {
     unsigned long pc;      uintptr_t pc;
     int count;      int count;
     struct disassemble_info disasm_info;      struct disassemble_info disasm_info;
     int (*print_insn)(bfd_vma pc, disassemble_info *info);      int (*print_insn)(bfd_vma pc, disassemble_info *info);
Line 265  void disas(FILE *out, void *code, unsign Line 276  void disas(FILE *out, void *code, unsign
     INIT_DISASSEMBLE_INFO(disasm_info, out, fprintf);      INIT_DISASSEMBLE_INFO(disasm_info, out, fprintf);
   
     disasm_info.buffer = code;      disasm_info.buffer = code;
     disasm_info.buffer_vma = (unsigned long)code;      disasm_info.buffer_vma = (uintptr_t)code;
     disasm_info.buffer_length = size;      disasm_info.buffer_length = size;
   
 #ifdef HOST_WORDS_BIGENDIAN  #ifdef HOST_WORDS_BIGENDIAN
Line 309  void disas(FILE *out, void *code, unsign Line 320  void disas(FILE *out, void *code, unsign
             (long) code);              (long) code);
     return;      return;
 #endif  #endif
     for (pc = (unsigned long)code; size > 0; pc += count, size -= count) {      for (pc = (uintptr_t)code; size > 0; pc += count, size -= count) {
         fprintf(out, "0x%08lx:  ", pc);          fprintf(out, "0x%08" PRIxPTR ":  ", pc);
         count = print_insn(pc, &disasm_info);          count = print_insn(pc, &disasm_info);
         fprintf(out, "\n");          fprintf(out, "\n");
         if (count < 0)          if (count < 0)
Line 339  const char *lookup_symbol(target_ulong o Line 350  const char *lookup_symbol(target_ulong o
 #include "monitor.h"  #include "monitor.h"
   
 static int monitor_disas_is_physical;  static int monitor_disas_is_physical;
 static CPUState *monitor_disas_env;  static CPUArchState *monitor_disas_env;
   
 static int  static int
 monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length,  monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length,
Line 363  monitor_fprintf(FILE *stream, const char Line 374  monitor_fprintf(FILE *stream, const char
     return 0;      return 0;
 }  }
   
 void monitor_disas(Monitor *mon, CPUState *env,  void monitor_disas(Monitor *mon, CPUArchState *env,
                    target_ulong pc, int nb_insn, int is_physical, int flags)                     target_ulong pc, int nb_insn, int is_physical, int flags)
 {  {
     int count, i;      int count, i;
Line 421  void monitor_disas(Monitor *mon, CPUStat Line 432  void monitor_disas(Monitor *mon, CPUStat
 #elif defined(TARGET_S390X)  #elif defined(TARGET_S390X)
     disasm_info.mach = bfd_mach_s390_64;      disasm_info.mach = bfd_mach_s390_64;
     print_insn = print_insn_s390;      print_insn = print_insn_s390;
   #elif defined(TARGET_LM32)
       disasm_info.mach = bfd_mach_lm32;
       print_insn = print_insn_lm32;
 #else  #else
     monitor_printf(mon, "0x" TARGET_FMT_lx      monitor_printf(mon, "0x" TARGET_FMT_lx
                    ": Asm output not supported on this arch\n", pc);                     ": Asm output not supported on this arch\n", pc);

Removed from v.1.1.1.13  
changed lines
  Added in v.1.1.1.14


unix.superglobalmegacorp.com