aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-varobj.c5
-rw-r--r--gdb/python/python-internal.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/gdb/python/py-varobj.c b/gdb/python/py-varobj.c
index c3fb2e9..dfc9e2b 100644
--- a/gdb/python/py-varobj.c
+++ b/gdb/python/py-varobj.c
@@ -133,7 +133,7 @@ py_varobj_iter::py_varobj_iter (struct varobj *var, gdbpy_ref<> &&pyiter)
/* Return a new pretty-printed varobj iterator suitable to iterate
over VAR's children. */
-struct varobj_iter *
+std::unique_ptr<varobj_iter>
py_varobj_get_iterator (struct varobj *var, PyObject *printer)
{
gdbpy_enter_varobj enter_py (var);
@@ -156,5 +156,6 @@ py_varobj_get_iterator (struct varobj *var, PyObject *printer)
error (_("Could not get children iterator"));
}
- return new py_varobj_iter (var, std::move (iter));
+ return std::unique_ptr<varobj_iter> (new py_varobj_iter (var,
+ std::move (iter)));
}
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 3fdfede..f7e1edc 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -754,8 +754,8 @@ int gdb_pymodule_addobject (PyObject *module, const char *name,
struct varobj_iter;
struct varobj;
-struct varobj_iter *py_varobj_get_iterator (struct varobj *var,
- PyObject *printer);
+std::unique_ptr<varobj_iter> py_varobj_get_iterator (struct varobj *var,
+ PyObject *printer);
/* Deleter for Py_buffer unique_ptr specialization. */