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.
+2002-04-09 Andrew Cagney <ac131313@redhat.com>
+
+ * 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.
+
2002-04-09 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/Makefile.in: Add stamp-h target.
/* Cache and manage the values of registers for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000, 2001
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
+ 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
Returns 1 if could not be read, 0 if could. */
-/* FIXME: This function increases the confusion between FP_REGNUM
- and the virtual/pseudo-frame pointer. */
-
static int
read_relative_register_raw_bytes_for_frame (int regnum,
char *myaddr,
struct frame_info *frame)
{
int optim;
- if (regnum == FP_REGNUM && frame)
- {
- /* Put it back in target format. */
- store_address (myaddr, REGISTER_RAW_SIZE (FP_REGNUM),
- (LONGEST) FRAME_FP (frame));
-
- return 0;
- }
-
get_saved_register (myaddr, &optim, (CORE_ADDR *) NULL, frame,
regnum, (enum lval_type *) NULL);
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)
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);
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
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 (
/* Parser definitions for GDB.
- Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000 Free Software Foundation, Inc.
+
+ Copyright 1986, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+
Modified from expread.y by the Department of Computer Science at the
State University of New York at Buffalo.
#include "doublest.h"
-struct std_regs
- {
- char *name;
- int regnum;
- };
-
-extern struct std_regs *std_regs;
-extern unsigned num_std_regs;
-
extern struct expression *expout;
extern int expout_size;
extern int expout_ptr;
};
/* 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;
+ and builtin regs. */
extern int target_map_name_to_register (char *, int);