Avoid some manual memory management in Python
authorTom Tromey <tom@tromey.com>
Mon, 1 May 2017 04:10:41 +0000 (22:10 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 3 Aug 2017 13:59:07 +0000 (07:59 -0600)
commit7f968c899f21643322dcfaf807ec7d7bee7c9974
treecc45bbdc0afdeb352f530fd22795c9a36774d8e0
parent3c9ebddd93ffb8b44b8cc69f3be9db08c861368e
Avoid some manual memory management in Python

This changes a few places in the Python code to avoid manual memory
management, in favor of letting std::string do the work.

ChangeLog
2017-08-03  Tom Tromey  <tom@tromey.com>

* python/python.c (compute_python_string): Return std::string.
(gdbpy_eval_from_control_command): Update.
(do_start_initialization): Use std::string.
* python/py-varobj.c (py_varobj_iter_next): Use string_printf, not
xstrprintf.
* python/py-breakpoint.c (local_setattro): Use string_printf, not
xstrprintf.
gdb/ChangeLog
gdb/python/py-breakpoint.c
gdb/python/py-varobj.c
gdb/python/python.c