OSDN Git Service

* mips-dis.c (print_insn_arg): Don't use software integer registers
authorThiemo Seufer <ths@networkno.de>
Tue, 7 Aug 2001 12:36:13 +0000 (12:36 +0000)
committerThiemo Seufer <ths@networkno.de>
Tue, 7 Aug 2001 12:36:13 +0000 (12:36 +0000)
for coprocessor registers.
(_print_insn_mips): Get distinction between old ABI and new ABI right.

opcodes/ChangeLog
opcodes/mips-dis.c

index bf3e14a..3027687 100644 (file)
@@ -1,3 +1,11 @@
+2001-07-21  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+       * mips-dis.c (print_insn_arg): Don't use software integer registers
+       for coprocessor registers.
+       (get_mips_isa): Removed.
+       (is_newabi): New function, checks if NewABI is used.
+       (_print_insn_mips): Get distinction between old ABI and new ABI right.
+
 2001-08-01  Christian Groessler <cpg@aladdin.de>
 
        * z8kgen.c: Fixed indentation of opt[] array.  Include stdio.h to
index 3d737f6..97f263d 100644 (file)
@@ -256,13 +256,13 @@ print_insn_arg (d, l, pc, info)
       break;
 
     case 'E':
-      (*info->fprintf_func) (info->stream, "%s",
-                            reg_names[(l >> OP_SH_RT) & OP_MASK_RT]);
+      (*info->fprintf_func) (info->stream, "$%d",
+                            (l >> OP_SH_RT) & OP_MASK_RT);
       break;
 
     case 'G':
-      (*info->fprintf_func) (info->stream, "%s",
-                            reg_names[(l >> OP_SH_RD) & OP_MASK_RD]);
+      (*info->fprintf_func) (info->stream, "$%d",
+                            (l >> OP_SH_RD) & OP_MASK_RD);
       break;
 
     case 'N':
@@ -395,17 +395,19 @@ mips_isa_type (mach, isa, cputype)
     }
 }
 
-/* Figure out ISA from disassemble_info data */
+/* Check if the object uses NewABI conventions.  */
 
 static int
-get_mips_isa (info)
-     struct disassemble_info *info;
+is_newabi(header)
+     Elf_Internal_Ehdr *header;
 {
-  int isa;
-  int cpu;
+  if ((header->e_flags
+       & (E_MIPS_ABI_EABI32 | E_MIPS_ABI_EABI64 | EF_MIPS_ABI2)) != 0
+      || (header->e_ident[EI_CLASS] == ELFCLASS64
+         && (header->e_flags & E_MIPS_ABI_O64) == 0))
+    return 1;
 
-  mips_isa_type (info->mach, &isa, &cpu);
-  return isa;
+  return 0;
 }
 \f
 /* Print the mips instruction at address MEMADDR in debugged memory,
@@ -522,14 +524,16 @@ _print_insn_mips (memaddr, info, endianness)
 #endif
 
   /* Use mips64_reg_names for new ABI.  */
-  if (info->flavour == bfd_target_elf_flavour
-      && info->symbols != NULL
-      && (((get_mips_isa(info) | INSN_ISA_MASK) & ISA_MIPS2) != 0)
-      && ((elf_elfheader (bfd_asymbol_bfd(*(info->symbols)))->e_flags
-          & EF_MIPS_ABI2) != 0))
-    reg_names = mips64_reg_names;
-  else
-    reg_names = mips32_reg_names;
+  reg_names = mips32_reg_names;
+
+  if (info->flavour == bfd_target_elf_flavour && info->symbols != NULL)
+    {
+      Elf_Internal_Ehdr *header;
+
+      header = elf_elfheader(bfd_asymbol_bfd(*(info->symbols)));
+      if (is_newabi(header))
+       reg_names = mips64_reg_names;
+    }
 
   status = (*info->read_memory_func) (memaddr, buffer, INSNLEN, info);
   if (status == 0)