diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-07-07 14:36:58 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-07-07 14:36:58 +0000 |
commit | eb8bc2821737a21e228c59dfce228e03cb7586a8 (patch) | |
tree | 814fd415266ca957741bcbd1850b95ece7b06164 /gdb/frame.c | |
parent | 15f8604d21deffab6450bd32418774857104503d (diff) | |
download | gdb-eb8bc2821737a21e228c59dfce228e03cb7586a8.zip gdb-eb8bc2821737a21e228c59dfce228e03cb7586a8.tar.gz gdb-eb8bc2821737a21e228c59dfce228e03cb7586a8.tar.bz2 |
2003-07-07 Andrew Cagney <cagney@redhat.com>
* expprint.c: Include "user-regs.h" instead of "frame.h".
(print_subexp): Use user_reg_map_regnum_to_name, instead of
frame_map_regnum_to_name.
* frame.c: Include "user-regs.h" instead of "builtin-regs.h".
(frame_map_name_to_regnum): Simplify, call
user_reg_map_name_to_regnum.
(frame_map_regnum_to_name): Simplify, call
user_reg_map_regnum_to_name.
(frame_register_unwind): Update.
* std-regs.c: Include "user-regs.h" instead of "builtin-regs.h".
(_initialize_frame_reg): Call user_reg_add_builtin.
* findvar.c: Include "user-regs.h" instead of "builtin-regs.h".
(value_of_register): Use value_of_user_reg.
* eval.c (evaluate_subexp_standard): Update.
* parse.c (write_dollar_variable): Update.
* d10v-tdep.c (d10v_print_registers_info): Update.
* infcmd.c (registers_info): Update.
* Makefile.in (SFILES): Delete "builtin-regs.c", add "user-regs.c".
(builtin_regs_h): Delete macro.
(user_regs_h): Define.
(COMMON_OBS): Delete "builtin-regs.o", add "user-regs.o".
(builtin-regs.o): Delete target.
(user-regs.o): Specify dependencies.
(expprint.o): Update dependencies.
(findvar.o): Update dependencies.
(frame.o): Update dependencies.
(std-regs.o): Update dependencies.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r-- | gdb/frame.c | 39 |
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. */ |