- To: gdb-patches at sourceware dot cygnus dot com
- Subject: RFA [eval.c]: Fix handling of registers when EVAL_AVOID_SIDE_EFFECTS
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Thu, 22 Jun 2000 21:16:56 -0400
- Organization: Red Hat , Inc. - Toronto
As registers had no types no one noticed this before.
We must not try to read the value when we just want the type
(i.e., EVAL_AVOID_SIDE_EFFECTS was specified).
This patches corrects this omission.
OK to commit?
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
Index: ChangeLog
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/ChangeLog,v
retrieving revision 1.5979.4.25
diff -c -p -r1.5979.4.25 ChangeLog
*** ChangeLog 2000/06/16 23:47:43 1.5979.4.25
--- ChangeLog 2000/06/23 00:46:50
***************
*** 1,3 ****
--- 1,9 ----
+ 2000-06-22 Fernando Nasser <fnasser@cygnus.com>
+
+ * eval.c (evaluate_subexp_standard): Do not try to read the register
+ value when EVAL_AVOID_SIDE_EFFECTS was specified -- we only want the
+ type.
+
2000-06-16 Fernando Nasser <fnasser@cygnus.com>
* i386-tdep.c (valid_flavors[]): Remove "int-16" mode.
Index: eval.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/eval.c,v
retrieving revision 1.111
diff -c -p -r1.111 eval.c
*** eval.c 2000/05/01 04:46:47 1.111
--- eval.c 2000/06/23 00:46:50
*************** evaluate_subexp_standard (expect_type, e
*** 451,458 ****
case OP_REGISTER:
{
int regno = longest_to_int (exp->elts[pc + 1].longconst);
! value_ptr val = value_of_register (regno);
(*pos) += 2;
if (val == NULL)
--- 451,463 ----
case OP_REGISTER:
{
+ value_ptr val;
int regno = longest_to_int (exp->elts[pc + 1].longconst);
!
! if (noside == EVAL_AVOID_SIDE_EFFECTS)
! return value_zero (REGISTER_VIRTUAL_TYPE (regno), lval_register);
!
! val = value_of_register (regno);
(*pos) += 2;
if (val == NULL)