aboutsummaryrefslogtreecommitdiff
path: root/gdb/expprint.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-09-25 20:30:38 +0000
committerAndrew Cagney <cagney@redhat.com>2002-09-25 20:30:38 +0000
commite36180d7954250489b69c8ad2050bc6b2af27b5c (patch)
treef1c2bfc966cc91806f99908c05ae5060731f82c2 /gdb/expprint.c
parent58daee9877b50241b1fd49b2ad5d13ca70c0c866 (diff)
downloadgdb-e36180d7954250489b69c8ad2050bc6b2af27b5c.zip
gdb-e36180d7954250489b69c8ad2050bc6b2af27b5c.tar.gz
gdb-e36180d7954250489b69c8ad2050bc6b2af27b5c.tar.bz2
2002-09-25 Andrew Cagney <cagney@redhat.com>
* frame.c: Include "gdb_string.h" and "builtin-regs.h". (frame_map_regnum_to_name): New function. (frame_map_name_to_regnum): New function. * frame.h (frame_map_name_to_regnum): Declare. (frame_map_regnum_to_name): Declare. * builtin-regs.c (builtin_reg_map_regnum_to_name): New function. * builtin-regs.h (builtin_reg_map_regnum_to_name): Declare. * parse.c: Do not include "builtin-regs.h". (target_map_name_to_register): Delete function. (write_dollar_variable): Use frame_map_name_to_regnum. * parser-defs.h (target_map_name_to_register): Delete declaration. * expprint.c: Include "frame.h". (print_subexp): Use frame_map_regnum_to_name. * eval.c (evaluate_subexp_standard): Use frame_map_regnum_to_name. * infcmd.c (registers_info): Use frame_map_name_to_regnum. 2002-09-25 Andrew Cagney <cagney@redhat.com> * gdb.base/pc-fp.exp, gdb.base/pc-fp.c: New test.
Diffstat (limited to 'gdb/expprint.c')
-rw-r--r--gdb/expprint.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/expprint.c b/gdb/expprint.c
index 9f3f171..aa8b876 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -26,6 +26,7 @@
#include "value.h"
#include "language.h"
#include "parser-defs.h"
+#include "frame.h" /* For frame_map_regnum_to_name. */
#ifdef HAVE_CTYPE_H
#include <ctype.h>
@@ -119,10 +120,12 @@ print_subexp (register struct expression *exp, register int *pos,
return;
case OP_REGISTER:
- (*pos) += 2;
- fprintf_filtered (stream, "$%s",
- REGISTER_NAME (longest_to_int (exp->elts[pc + 1].longconst)));
- return;
+ {
+ int regnum = longest_to_int (exp->elts[pc + 1].longconst);
+ (*pos) += 2;
+ fprintf_filtered (stream, "$%s", frame_map_regnum_to_name (regnum));
+ return;
+ }
case OP_BOOL:
(*pos) += 2;