* findvar.c: Include "builtin-regs.h".

(value_of_register): Call value_of_builtin_reg when applicable.
* parse.c: Include "builtin-regs.h" and "gdb_assert.h".
(target_map_name_to_register): Call
builtin_reg_map_name_to_regnum.
* Makefile.in (SFILES): Add builtin-regs.c and std-regs.c.
(COMMON_OBS): Add builtin-regs.o and std-regs.o.
(builtin_regs_h): Define.
(builtin-regs.o): New target.
(findvar.o): Add $(builtin_regs_h).
* builtin-regs.c, builtin-regs.h: New files.
* std-regs.c: New file.
Partial fix for PR gdb/251.
This commit is contained in:
Andrew Cagney
2002-04-09 03:06:14 +00:00
parent 56a6dfb9de
commit 0406ec40ea
7 changed files with 304 additions and 1 deletions

View File

@ -33,6 +33,7 @@
#include "floatformat.h"
#include "symfile.h" /* for overlay functions */
#include "regcache.h"
#include "builtin-regs.h"
/* Basic byte-swapping routines. GDB has needed these for a long time...
All extract a target-format integer at ADDR which is LEN bytes long. */
@ -299,6 +300,11 @@ value_of_register (int regnum, struct frame_info *frame)
char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
enum lval_type lval;
/* Builtin registers lie completly outside of the range of normal
registers. Catch them early so that the target never sees them. */
if (regnum >= NUM_REGS + NUM_PSEUDO_REGS)
return value_of_builtin_reg (regnum, selected_frame);
get_saved_register (raw_buffer, &optim, &addr,
frame, regnum, &lval);