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

src/gdb varobj.c ChangeLog


CVSROOT:	/cvs/src
Module name:	src
Changes by:	qiyao@sourceware.org	2013-10-04 07:16:45

Modified files:
	gdb            : varobj.c ChangeLog 

Log message:
	Fix FIXME: xstrdup should not be here
	
	Hi,
	
	This FIXME goes into my eyes, when I am about to modify something here,
	
	/* Name is allocated by name_of_child.  */
	/* FIXME: xstrdup should not be here.  */
	
	This FIXME was introduced in the python pretty-pretter patches.
	
	Python pretty-printing [6/6]
	https://sourceware.org/ml/gdb-patches/2009-05/msg00467.html
	
	create_child_with_value is called in two paths,
	
	1. varobj_list_children -> create_child -> create_child_with_value,
	2. install_dynamic_child -> install_dynamic_child -> varobj_add_child
	-> create_child_with_value
	
	In path #1, 'name' is allocated by name_of_child, as the original
	comment said, we don't have to duplicate NAME in
	create_child_with_value.  In path #2, 'name' is got from
	PyArg_ParseTuple, and we have to duplicate NAME.
	
	This patch removes the call to xstrdup in create_child_with_value
	and call xstrudp in update_dynamic_varobj_children (path #2).
	
	gdb:
	
	2013-10-04  Yao Qi  <yao@codesourcery.com>
	
	* varobj.c (create_child_with_value): Remove 'const' from the
	type of parameter 'name'.
	(varobj_add_child): Likewise.
	(install_dynamic_child): Remove 'const' from the type of
	parameter 'name'.
	(varobj_add_child): Likewise.
	(create_child_with_value): Likewise.  Update comments.  Don't
	duplicate 'name'.
	(update_dynamic_varobj_children): Duplicate 'name'
	and pass it to install_dynamic_child.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/varobj.c.diff?cvsroot=src&r1=1.213&r2=1.214
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.16067&r2=1.16068


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