This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH] MI: Free values when updating


 > >  > Why? Is it because the memory consumption of gdb grows, or because the
 > >  > list of released values grows without ever being cleared, or for some
 > >  > other reason?
 > > 
 > > The latter, I think.
 > 
 > Except that there isn't a list of released values.  So what is GDB
 > doing that is taking longer and longer?

The list of *unreleased* values (all_values?) grows.  That should change
now free_all_values gets called from mi_execute_command.

 > > I think if you also remove the (3) calls to release_value in
 > > c_value_of_child and cplus_value_of_child this is equivalent to my change
 > > (and more tidy).
 > 
 > No, those are different.  They come from things like the call to
 > gdb_value_ind in c_describe_child.  That creates a new value, which is
 > returned to the caller (the MI front end, to be printed and later
 > released).  It's the ones in c_value_of_root which matter, because we
 > save them in the varobj.

In varobj_update:

	  new = value_of_child (v->parent, v->index);
	  if (install_new_value (v, new, 0 /* type not changed */))

In create_child:

  value = value_of_child (parent, index);
  ...
  install_new_value (child, value, 1);

Now install_new_value calls release_value on new, it's not neeeded in
*_value_of_child.  I've tried this change on the MI testsuite and see no fails
and it has about the same time improvement that my patch had.  If this is not
the right patch then the testsuite is lacking the appropriate test.  Can you
create a test where this patch fails?

-- 
Nick                                           http://www.inet.net.nz/~nickrob


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