aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-01-30 18:46:08 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-01-30 18:46:08 +0000
commit80f064a256d119c77a33e01cf86f346240493b76 (patch)
tree28c5adb07e1f355b0d923997875a58a1aeda1405 /gdb/eval.c
parent6e6c6f5087f4ad1c46f099e0edb175d526ebeee6 (diff)
downloadgdb-80f064a256d119c77a33e01cf86f346240493b76.zip
gdb-80f064a256d119c77a33e01cf86f346240493b76.tar.gz
gdb-80f064a256d119c77a33e01cf86f346240493b76.tar.bz2
* eval.c (evaluate_subexp_standard): Add handling of user
registers when in EVAL_AVOID_SIDE_EFFECTS mode.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index bcbd061..6e5be65 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -512,7 +512,15 @@ evaluate_subexp_standard (struct type *expect_type,
name, strlen (name));
if (regno == -1)
error (_("Register $%s not available."), name);
- if (noside == EVAL_AVOID_SIDE_EFFECTS)
+
+ /* In EVAL_AVOID_SIDE_EFFECTS mode, we only need to return
+ a value with the appropriate register type. Unfortunately,
+ we don't have easy access to the type of user registers.
+ So for these registers, we fetch the register value regardless
+ of the evaluation mode. */
+ if (noside == EVAL_AVOID_SIDE_EFFECTS
+ && regno < gdbarch_num_regs (current_gdbarch)
+ + gdbarch_num_pseudo_regs (current_gdbarch))
val = value_zero (register_type (current_gdbarch, regno), not_lval);
else
val = value_of_register (regno, get_selected_frame (NULL));