This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[Fwd: RFA [eval.c]: Fix handling of registers when EVAL_AVOID_SIDE_EFFECTS]


Fernando,

I don't think this is right, when EVAL_AVOID_SIDE_EFFECTS, the code 
returns before the:

	(*pos) += 2;

Andrew


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)




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]