aboutsummaryrefslogtreecommitdiff
path: root/gdb/parse.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-04-09 22:14:39 +0000
committerAndrew Cagney <cagney@redhat.com>2002-04-09 22:14:39 +0000
commit96cb11df6d280f0bba0c181b500d66c853cd377e (patch)
tree8050d9934354c372d02b6e74745b1179c9697058 /gdb/parse.c
parentc3a3ccc760b65f919d46a871f07bcc1c8e44efff (diff)
downloadgdb-96cb11df6d280f0bba0c181b500d66c853cd377e.zip
gdb-96cb11df6d280f0bba0c181b500d66c853cd377e.tar.gz
gdb-96cb11df6d280f0bba0c181b500d66c853cd377e.tar.bz2
* frame.c (read_relative_register_raw_bytes_for_frame): Do not
override FP_REGNUM with frame->fp. Update copyright. * parse.c (num_std_regs, std_regs): Delete. (target_map_name_to_register): Do not search std_regs. Update function description. * parser-defs.h (num_std_regs, std_regs, struct std_regs): Delete declarations. Update copyright. Fix PR gdb/251.
Diffstat (limited to 'gdb/parse.c')
-rw-r--r--gdb/parse.c83
1 files changed, 9 insertions, 74 deletions
diff --git a/gdb/parse.c b/gdb/parse.c
index eae5586..1a1003b 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -104,15 +104,9 @@ struct funcall
static struct funcall *funcall_chain;
-/* Assign machine-independent names to certain registers
- (unless overridden by the REGISTER_NAMES table) */
-
-unsigned num_std_regs = 0;
-struct std_regs *std_regs;
-
/* The generic method for targets to specify how their registers are
- named. The mapping can be derived from three sources:
- REGISTER_NAME; std_regs; or a target specific alias hook. */
+ named. The mapping can be derived from two sources: REGISTER_NAME;
+ or builtin regs. */
int
target_map_name_to_register (char *str, int len)
@@ -127,13 +121,13 @@ target_map_name_to_register (char *str, int len)
return i;
}
- /* Try standard aliases. */
- for (i = 0; i < num_std_regs; i++)
- if (std_regs[i].name && len == strlen (std_regs[i].name)
- && STREQN (str, std_regs[i].name, len))
- {
- return std_regs[i].regnum;
- }
+ /* Try builtin registers. */
+ i = builtin_reg_map_name_to_regnum (str, len);
+ if (i >= 0)
+ {
+ gdb_assert (i >= NUM_REGS + NUM_PSEUDO_REGS);
+ return i;
+ }
/* Try builtin registers. */
i = builtin_reg_map_name_to_regnum (str, len);
@@ -1361,63 +1355,6 @@ build_parse (void)
init_type (TYPE_CODE_INT, 1, 0,
"<variable (not text or data), no debug info>",
NULL);
-
- /* create the std_regs table */
-
- num_std_regs = 0;
-#ifdef PC_REGNUM
- if (PC_REGNUM >= 0)
- num_std_regs++;
-#endif
-#ifdef FP_REGNUM
- if (FP_REGNUM >= 0)
- num_std_regs++;
-#endif
-#ifdef SP_REGNUM
- if (SP_REGNUM >= 0)
- num_std_regs++;
-#endif
-#ifdef PS_REGNUM
- if (PS_REGNUM >= 0)
- num_std_regs++;
-#endif
- /* create an empty table */
- std_regs = xmalloc ((num_std_regs + 1) * sizeof *std_regs);
- i = 0;
- /* fill it in */
-#ifdef PC_REGNUM
- if (PC_REGNUM >= 0)
- {
- std_regs[i].name = "pc";
- std_regs[i].regnum = PC_REGNUM;
- i++;
- }
-#endif
-#ifdef FP_REGNUM
- if (FP_REGNUM >= 0)
- {
- std_regs[i].name = "fp";
- std_regs[i].regnum = FP_REGNUM;
- i++;
- }
-#endif
-#ifdef SP_REGNUM
- if (SP_REGNUM >= 0)
- {
- std_regs[i].name = "sp";
- std_regs[i].regnum = SP_REGNUM;
- i++;
- }
-#endif
-#ifdef PS_REGNUM
- if (PS_REGNUM >= 0)
- {
- std_regs[i].name = "ps";
- std_regs[i].regnum = PS_REGNUM;
- i++;
- }
-#endif
- memset (&std_regs[i], 0, sizeof (std_regs[i]));
}
void
@@ -1437,8 +1374,6 @@ _initialize_parse (void)
register_gdbarch_swap (&msym_data_symbol_type, sizeof (msym_data_symbol_type), NULL);
register_gdbarch_swap (&msym_unknown_symbol_type, sizeof (msym_unknown_symbol_type), NULL);
- register_gdbarch_swap (&num_std_regs, sizeof (std_regs), NULL);
- register_gdbarch_swap (&std_regs, sizeof (std_regs), NULL);
register_gdbarch_swap (NULL, 0, build_parse);
add_show_from_set (