This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch][python] Implement Python lazy strings (PR 10705)
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> Here is an updated patch. What do you think?
A couple more notes.
Phil> +gdbpy_extract_lazy_string (PyObject *string, struct type **str_type,
Phil> + long *length, char **encoding)
Phil> +{
[...]
Phil> + py_len = PyObject_GetAttrString (string, "length");
Phil> + py_encoding = PyObject_GetAttrString (string, "encoding");
Phil> + py_addr = PyObject_GetAttrString (string, "address");
Phil> + py_type = PyObject_GetAttrString (string, "type");
[...]
Phil> + Py_DECREF (py_len);
Phil> + Py_XDECREF (py_encoding);
Nothing ever frees py_addr or py_type.
This is true for the error case as well.
Phil> +PyObject *execute_pretty_printer (PyObject *printer);
This is declared but never defined or used.
Tom