This is the mail archive of the gdb@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]

FYI: Fix to varobj.c commited


I commited the following change:

2000-10-13  Fernando Nasser  <fnasser@totem.to.cygnus.com>

	* varobj.c (varobj_update): Prevent uninitialized error code to be
	returned on type_changed.  Also, prevent value_equal() to be called
	for the types we do not want to test for updates.

-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -c -p -r1.8 -r1.9
*** varobj.c	2000/09/16 00:49:37	1.8
--- varobj.c	2000/10/13 20:31:38	1.9
*************** varobj_update (struct varobj *var, struc
*** 917,937 ****
    /* Initialize a stack for temporary results */
    vpush (&result, NULL);
  
!   if (type_changed || !my_value_equal (var->value, new, &error2))
      {
!       /* Note that it's changed   There a couple of exceptions here,
!          though. We don't want some types to be reported as 
! 	 "changed". The exception to this is if this is a 
! 	 "use_selected_frame" varobj, and its type has changed. */
!       if (type_changed || type_changeable (var))
! 	{
! 	  vpush (&result, var);
! 	  changed++;
! 	}
      }
!   /* error2 replaces var->error since this new value
!      WILL replace the old one. */
!   var->error = error2;
  
    /* We must always keep around the new value for this root
       variable expression, or we lose the updated children! */
--- 917,940 ----
    /* Initialize a stack for temporary results */
    vpush (&result, NULL);
  
!   /* If this is a "use_selected_frame" varobj, and its type has changed,
!      them note that it's changed. */
!   if (type_changed)
      {
!       vpush (&result, var);
!       changed++;
      }
!   /* If values are not equal, note that it's changed.
!      There a couple of exceptions here, though.
!      We don't want some types to be reported as "changed". */
!   else if (type_changeable (var) && !my_value_equal (var->value, new, &error2))
!     {
!       vpush (&result, var);
!       changed++;
!       /* error2 replaces var->error since this new value
!          WILL replace the old one. */
!       var->error = error2;
!     }
  
    /* We must always keep around the new value for this root
       variable expression, or we lose the updated children! */

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