aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c39
1 files changed, 6 insertions, 33 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index b241cc4..3793a06 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -28,7 +28,7 @@
#include "regcache.h"
#include "gdb_assert.h"
#include "gdb_string.h"
-#include "builtin-regs.h"
+#include "user-regs.h"
#include "gdb_obstack.h"
#include "dummy-frame.h"
#include "sentinel-frame.h"
@@ -497,7 +497,7 @@ frame_register_unwind (struct frame_info *frame, int regnum,
{
fprintf_unfiltered (gdb_stdlog,
"{ frame_register_unwind (frame=%d,regnum=\"%s\",...) ",
- frame->level, frame_map_regnum_to_name (regnum));
+ frame->level, frame_map_regnum_to_name (frame, regnum));
}
/* Require all but BUFFERP to be valid. A NULL BUFFERP indicates
@@ -773,42 +773,15 @@ frame_register_read (struct frame_info *frame, int regnum, void *myaddr)
includes builtin registers. */
int
-frame_map_name_to_regnum (const char *name, int len)
+frame_map_name_to_regnum (struct frame_info *frame, const char *name, int len)
{
- int i;
-
- if (len < 0)
- len = strlen (name);
-
- /* Search register name space. */
- for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
- if (REGISTER_NAME (i) && len == strlen (REGISTER_NAME (i))
- && strncmp (name, REGISTER_NAME (i), len) == 0)
- {
- return i;
- }
-
- /* Try builtin registers. */
- i = builtin_reg_map_name_to_regnum (name, len);
- if (i >= 0)
- {
- /* A builtin register doesn't fall into the architecture's
- register range. */
- gdb_assert (i >= NUM_REGS + NUM_PSEUDO_REGS);
- return i;
- }
-
- return -1;
+ return user_reg_map_name_to_regnum (get_frame_arch (frame), name, len);
}
const char *
-frame_map_regnum_to_name (int regnum)
+frame_map_regnum_to_name (struct frame_info *frame, int regnum)
{
- if (regnum < 0)
- return NULL;
- if (regnum < NUM_REGS + NUM_PSEUDO_REGS)
- return REGISTER_NAME (regnum);
- return builtin_reg_map_regnum_to_name (regnum);
+ return user_reg_map_regnum_to_name (get_frame_arch (frame), regnum);
}
/* Create a sentinel frame. */