Use gdbpy_ref in pyuw_object_attribute_to_pointer
This changes pyuw_object_attribute_to_pointer to use gdbpy_ref. 2017-01-10 Tom Tromey <tom@tromey.com> * python/py-unwind.c (pyuw_object_attribute_to_pointer): Use gdbpy_ref.
This commit is contained in:
parent
59876f8f9f
commit
4586d54305
2 changed files with 7 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2017-01-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* python/py-unwind.c (pyuw_object_attribute_to_pointer): Use
|
||||||
|
gdbpy_ref.
|
||||||
|
|
||||||
2017-01-10 Tom Tromey <tom@tromey.com>
|
2017-01-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* python/python.c (eval_python_command, gdbpy_decode_line)
|
* python/python.c (eval_python_command, gdbpy_decode_line)
|
||||||
|
|
|
@ -177,18 +177,17 @@ pyuw_object_attribute_to_pointer (PyObject *pyo, const char *attr_name,
|
||||||
|
|
||||||
if (PyObject_HasAttrString (pyo, attr_name))
|
if (PyObject_HasAttrString (pyo, attr_name))
|
||||||
{
|
{
|
||||||
PyObject *pyo_value = PyObject_GetAttrString (pyo, attr_name);
|
gdbpy_ref pyo_value (PyObject_GetAttrString (pyo, attr_name));
|
||||||
|
|
||||||
if (pyo_value != NULL && pyo_value != Py_None)
|
if (pyo_value != NULL && pyo_value != Py_None)
|
||||||
{
|
{
|
||||||
rc = pyuw_value_obj_to_pointer (pyo_value, addr);
|
rc = pyuw_value_obj_to_pointer (pyo_value.get (), addr);
|
||||||
if (!rc)
|
if (!rc)
|
||||||
PyErr_Format (
|
PyErr_Format (
|
||||||
PyExc_ValueError,
|
PyExc_ValueError,
|
||||||
_("The value of the '%s' attribute is not a pointer."),
|
_("The value of the '%s' attribute is not a pointer."),
|
||||||
attr_name);
|
attr_name);
|
||||||
}
|
}
|
||||||
Py_XDECREF (pyo_value);
|
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue