From 80f064a256d119c77a33e01cf86f346240493b76 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Wed, 30 Jan 2008 18:46:08 +0000 Subject: [PATCH] * eval.c (evaluate_subexp_standard): Add handling of user registers when in EVAL_AVOID_SIDE_EFFECTS mode. --- gdb/ChangeLog | 5 +++++ gdb/eval.c | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 926af00d1d5..1c60b60c2f7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-01-30 Joel Brobecker + + * eval.c (evaluate_subexp_standard): Add handling of user + registers when in EVAL_AVOID_SIDE_EFFECTS mode. + 2008-01-30 Pierre Muller * eval.c (evaluate_subexp_standard): Support diff --git a/gdb/eval.c b/gdb/eval.c index bcbd061f376..6e5be65921c 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)); -- 2.30.2