aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2002-01-19 00:09:16 +0000
committerJason Thorpe <thorpej@netbsd.org>2002-01-19 00:09:16 +0000
commit636a6dfc8dc18715266999eb8cca1114c2297e54 (patch)
tree8a4fa2affa9321833a464dd1c64eddb7f46527ca /gdb
parent93d5c60074c0f3481a1e51cd46fe7f6ebcebe10a (diff)
downloadgdb-636a6dfc8dc18715266999eb8cca1114c2297e54.zip
gdb-636a6dfc8dc18715266999eb8cca1114c2297e54.tar.gz
gdb-636a6dfc8dc18715266999eb8cca1114c2297e54.tar.bz2
* alpha-tdep.c (alpha_register_name): New function.
* config/alpha/tm-alpha.h (REGISTER_NAMES): Remove. (REGISTER_NAME): Define.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/alpha-tdep.c24
-rw-r--r--gdb/config/alpha/tm-alpha.h20
3 files changed, 36 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 699062b..cfea83f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
+ * alpha-tdep.c (alpha_register_name): New function.
+ * config/alpha/tm-alpha.h (REGISTER_NAMES): Remove.
+ (REGISTER_NAME): Define.
+
+2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
+
* config/nm-nbsd.h (KERNEL_U_ADDR): Remove.
2002-01-18 Jason Thorpe <thorpej@wasabisystems.com>
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index be53a84..0ec3add 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -261,6 +261,30 @@ push_sigtramp_desc (CORE_ADDR low_addr)
}
+char *
+alpha_register_name (int regno)
+{
+ static char *register_names[] =
+ {
+ "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6",
+ "t7", "s0", "s1", "s2", "s3", "s4", "s5", "fp",
+ "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9",
+ "t10", "t11", "ra", "t12", "at", "gp", "sp", "zero",
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15",
+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "fpcr",
+ "pc", "vfp",
+ };
+
+ if (regno < 0)
+ return (NULL);
+ if (regno >= (sizeof(register_names) / sizeof(*register_names)))
+ return (NULL);
+ return (register_names[regno]);
+}
+
+
/* Guaranteed to set frame->saved_regs to some values (it never leaves it
NULL). */
diff --git a/gdb/config/alpha/tm-alpha.h b/gdb/config/alpha/tm-alpha.h
index 2e069eb..ad2e39b 100644
--- a/gdb/config/alpha/tm-alpha.h
+++ b/gdb/config/alpha/tm-alpha.h
@@ -99,20 +99,12 @@ extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *);
#define NUM_REGS 66
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES \
- { "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6", \
- "t7", "s0", "s1", "s2", "s3", "s4", "s5", "fp", \
- "a0", "a1", "a2", "a3", "a4", "a5", "t8", "t9", \
- "t10", "t11", "ra", "t12", "at", "gp", "sp", "zero", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
- "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",\
- "f24", "f25", "f26", "f27", "f28", "f29", "f30", "fpcr",\
- "pc", "vfp", \
- }
+
+/* Return the name of register REGNO. */
+
+#define REGISTER_NAME(regno) alpha_register_name ((regno))
+extern char *alpha_register_name (int);
+
/* Register numbers of various important registers.
Note that most of these values are "real" register numbers,