From: Richard Earnshaw Date: Mon, 21 Jan 2002 17:36:11 +0000 (+0000) Subject: * arm-tdep.c (arm_register_name): New function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=966fbf700aebef28157e7d482c7503374a4a36ac;p=binutils-gdb.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b2cac540f15..4fdc0eb439f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2002-01-21 Richard Earnshaw + + * 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 Kevin Buettner diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 4e57ec1d166..a7aa6263f78 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -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 (); } +/* 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) { diff --git a/gdb/config/arm/tm-arm.h b/gdb/config/arm/tm-arm.h index 8a0d61353ff..6bd95ad2211 100644 --- a/gdb/config/arm/tm-arm.h +++ b/gdb/config/arm/tm-arm.h @@ -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