aboutsummaryrefslogtreecommitdiff
path: root/gdb/findvar.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-04-09 03:06:14 +0000
committerAndrew Cagney <cagney@redhat.com>2002-04-09 03:06:14 +0000
commit0406ec40ea7e42729731ad29cb31aed0c8b35574 (patch)
tree6370d9a28d67895d18d5bebc8bd908fce388a4a9 /gdb/findvar.c
parent56a6dfb9deeb261da2dc2462ead99844ef865e4f (diff)
downloadgdb-0406ec40ea7e42729731ad29cb31aed0c8b35574.zip
gdb-0406ec40ea7e42729731ad29cb31aed0c8b35574.tar.gz
gdb-0406ec40ea7e42729731ad29cb31aed0c8b35574.tar.bz2
* 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.
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r--gdb/findvar.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c
index e94c150..06ad498 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -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);