diff options
author | qiyao <qiyao> | 2013-10-04 07:16:44 +0000 |
---|---|---|
committer | qiyao <qiyao> | 2013-10-04 07:16:44 +0000 |
commit | 17b0ea1ae0ae3d4dfe714e2c880a9377b8b344c3 (patch) | |
tree | 5e07a8be2ebc6fbf88cc2dd2a33ad6a021619744 /readline | |
parent | d34e7bc2d3c61af8ac4a7dabf4d2fd8adbf39b60 (diff) | |
download | gdb-17b0ea1ae0ae3d4dfe714e2c880a9377b8b344c3.tar.gz |
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.
Diffstat (limited to 'readline')
0 files changed, 0 insertions, 0 deletions