2000-02-14 Fernando Nasser <fnasser@totem.to.cygnus.com>
authorFernando Nasser <fnasser@redhat.com>
Mon, 14 Feb 2000 19:02:47 +0000 (19:02 +0000)
committerFernando Nasser <fnasser@redhat.com>
Mon, 14 Feb 2000 19:02:47 +0000 (19:02 +0000)
* arm-dis.c: Change flavor name from atpcs-special to
special-atpcs to prevent name conflict in gdb.
(get_arm_regname_num_options, set_arm_regname_option,
get_arm_regnames): New functions.  API to access the several
flavor of register names.  Note: Used by gdb.
(print_insn_thumb): Use the register name entry from the currently
selected flavor for LR and PC.

opcodes/ChangeLog
opcodes/arm-dis.c

index 2325da3..33dea54 100644 (file)
@@ -1,3 +1,13 @@
+2000-02-14  Fernando Nasser  <fnasser@totem.to.cygnus.com>
+
+       * arm-dis.c: Change flavor name from atpcs-special to
+       special-atpcs to prevent name conflict in gdb.
+       (get_arm_regname_num_options, set_arm_regname_option,
+       get_arm_regnames): New functions.  API to access the several
+       flavor of register names.  Note: Used by gdb.
+       (print_insn_thumb): Use the register name entry from the currently
+       selected flavor for LR and PC.
+
 2000-02-10  Nick Clifton  <nickc@cygnus.com>
 
        * mcore-opc.h (enum mcore_opclass): Add MULSH and OPSR
index a3f44db..f131ada 100644 (file)
@@ -66,7 +66,7 @@ static arm_regname regnames[] =
     { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "sl",  "fp",  "ip",  "sp",  "lr",  "pc" }},
   { "atpcs", "Select register names used in the ATPCS",
     { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "v6", "v7",  "v8",  "IP",  "SP",  "LR",  "PC" }},
-  { "atpcs-special", "Select special register names used in the ATPCS",
+  { "special-atpcs", "Select special register names used in the ATPCS",
     { "a1", "a2", "a3", "a4", "v1", "v2", "v3", "WR", "v5", "SB", "SL",  "FP",  "IP",  "SP",  "LR",  "PC" }}
 };
 
@@ -90,8 +90,38 @@ static int  print_insn_arm   PARAMS ((bfd_vma, struct disassemble_info *, long))
 static int  print_insn_thumb PARAMS ((bfd_vma, struct disassemble_info *, long));
 static void parse_disassembler_options PARAMS ((char *));
 static int  print_insn       PARAMS ((bfd_vma, struct disassemble_info *, boolean));
+int get_arm_regname_num_options (void);
+int set_arm_regname_option (int option);
+int get_arm_regnames (int option, const char **setname,
+                     const char **setdescription,
+                     const char ***register_names);
 \f
 /* Functions. */
+int
+get_arm_regname_num_options (void)
+{
+  return NUM_ARM_REGNAMES;
+}
+
+int
+set_arm_regname_option (int option)
+{
+  int old = regname_selected;
+  regname_selected = option;
+  return old;
+}
+
+int
+get_arm_regnames (int option, const char **setname,
+                 const char **setdescription,
+                  const char ***register_names)
+{
+  *setname = regnames[option].name;
+  *setdescription = regnames[option].description;
+  *register_names = regnames[option].reg_names;
+  return 16;
+}
+
 static void
 arm_decode_shift (given, func, stream)
      long given;
@@ -707,14 +737,14 @@ print_insn_thumb (pc, info, given)
                                 if (started)
                                   func (stream, ", ");
                                 started = 1;
-                                func (stream, "lr");
+                                func (stream, arm_regnames[14] /* "lr" */);
                               }
 
                             if (domaskpc)
                               {
                                 if (started)
                                   func (stream, ", ");
-                                func (stream, "pc");
+                                func (stream, arm_regnames[15] /* "pc" */);
                               }
 
                             func (stream, "}");