* arm-tdep.c (arm_register_name): New function.
authorRichard Earnshaw <richard.earnshaw@arm.com>
Mon, 21 Jan 2002 17:36:11 +0000 (17:36 +0000)
committerRichard Earnshaw <richard.earnshaw@arm.com>
Mon, 21 Jan 2002 17:36:11 +0000 (17:36 +0000)
(arm_registers_names): Make static.
* config/arm/tm-arm.h (arm_register_names): Delete declaration.
(arm_register_name): Declare.
(REGISTER_NAME): Use it.

gdb/ChangeLog
gdb/arm-tdep.c
gdb/config/arm/tm-arm.h

index b2cac540f1587e4184937537d16cc6dd56635ec2..4fdc0eb439f8af53f97f7c613ba41a3a8638af53 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-21  Richard Earnshaw  <rearnsha@arm.com>
+
+       * arm-tdep.c (arm_register_name): New function.
+       (arm_registers_names): Make static.
+       * config/arm/tm-arm.h (arm_register_names): Delete declaration.
+       (arm_register_name): Declare.
+       (REGISTER_NAME): Use it.
+
 2002-01-21  Richard Earnshaw  <rearnsha@arm.com>
            Kevin Buettner  <kevinb@redhat.com>
 
index 4e57ec1d1669935b5f1abafceda3324c00186e11..a7aa6263f7885bb5ef6f97b34c8b5bdb0e35eddc 100644 (file)
@@ -83,7 +83,7 @@ static char * arm_register_name_strings[] =
  "f0",  "f1",  "f2",  "f3",    /* 16 17 18 19 */
  "f4",  "f5",  "f6",  "f7",    /* 20 21 22 23 */
  "fps", "cpsr" };              /* 24 25       */
-char **arm_register_names = arm_register_name_strings;
+static char **arm_register_names = arm_register_name_strings;
 
 /* Valid register name flavors.  */
 static const char **valid_flavors;
@@ -2118,6 +2118,13 @@ set_disassembly_flavor_sfunc (char *args, int from_tty,
   set_disassembly_flavor ();
 }
 \f
+/* Return the ARM register name corresponding to register I.  */
+char *
+arm_register_name(int i)
+{
+  return arm_register_names[i];
+}
+
 static void
 set_disassembly_flavor (void)
 {
index 8a0d61353ffaf128d360cbc01178b9301f504bca..6bd95ad22116d90b64b3d9e2ed4d9a5e537fe848 100644 (file)
@@ -169,10 +169,8 @@ extern void arm_float_info (void);
 #define NUM_GREGS      16      /* Number of general purpose registers.  */
 #define NUM_REGS       (NUM_GREGS + NUM_FREGS + NUM_SREGS)
 
-/* An array of names of registers. */
-extern char **arm_register_names;
-
-#define REGISTER_NAME(i) arm_register_names[i]
+#define REGISTER_NAME(i) arm_register_name(i)
+char *arm_register_name (int);
 
 /* Register numbers of various important registers.  Note that some of
    these values are "real" register numbers, and correspond to the