diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-04-09 03:06:14 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-04-09 03:06:14 +0000 |
commit | 0406ec40ea7e42729731ad29cb31aed0c8b35574 (patch) | |
tree | 6370d9a28d67895d18d5bebc8bd908fce388a4a9 /gdb/parse.c | |
parent | 56a6dfb9deeb261da2dc2462ead99844ef865e4f (diff) | |
download | gdb-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/parse.c')
-rw-r--r-- | gdb/parse.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/parse.c b/gdb/parse.c index 40491cf..eae5586 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -47,6 +47,8 @@ #include "inferior.h" /* for NUM_PSEUDO_REGS. NOTE: replace with "gdbarch.h" when appropriate. */ #include "doublest.h" +#include "builtin-regs.h" +#include "gdb_assert.h" /* Symbols which architectures can redefine. */ @@ -133,6 +135,14 @@ target_map_name_to_register (char *str, int 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; + } + return -1; } |