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

[varobj.c] Small fix.


I was returning a stale value if I could not read the value of
a variable.  I am fixing that.

Tomorrow I will check this in.

-- 
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:47:00
***************
*** 1,3 ****
--- 1,8 ----
+ 2000-06-22  Fernando Nasser  <fnasser@cygnus.com>
+ 
+       * varobj.c (c_value_of_root): Return NULL when we are unable to read
+       the value of the variable.
+ 
  2000-06-16  Fernando Nasser  <fnasser@cygnus.com>
  
        * i386-tdep.c (valid_flavors[]): Remove "int-16" mode.
Index: varobj.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/varobj.c,v
retrieving revision 1.29
diff -c -p -r1.29 varobj.c
*** varobj.c    2000/04/03 07:19:10     1.29
--- varobj.c    2000/06/23 00:47:00
*************** c_value_of_root (var_handle)
*** 1930,1949 ****
              /* We need to catch errors because if
                 value_fetch_lazy fails we still want to continue
                 (after making val->error = 1) */
-             /* FIXME: Shouldn't be using VALUE_CONTENTS?  The
-                comment on value_fetch_lazy() says it is only
-                called from the macro... */
              if (!gdb_value_fetch_lazy (new_val))
                var->error = 1;
              else
                var->error = 0;
            }
        }
        else
!       var->error = 1;
!       
!       release_value (new_val);
!       return new_val;
      }
  
    return NULL;
--- 1930,1948 ----
              /* We need to catch errors because if
                 value_fetch_lazy fails we still want to continue
                 (after making val->error = 1) */
              if (!gdb_value_fetch_lazy (new_val))
                var->error = 1;
              else
                var->error = 0;
            }
+           release_value (new_val);
+           return new_val;
        }
        else
!         {
!         var->error = 1;
!           return NULL;
!         }
      }
  
    return NULL;

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