This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 07/20] Use gdbpy_enter in py-progspace.c
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Thu, 10 Nov 2016 15:19:34 -0700
- Subject: [RFA 07/20] Use gdbpy_enter in py-progspace.c
- Authentication-results: sourceware.org; auth=none
- References: <1478816387-27064-1-git-send-email-tom@tromey.com>
Change py-progspace.c to use gdbpy_enter.
2016-11-10 Tom Tromey <tom@tromey.com>
* python/py-progspace.c (py_free_pspace): Use gdbpy_enter.
---
gdb/ChangeLog | 4 ++++
gdb/python/py-progspace.c | 4 +---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6acb87a..3a25270 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2016-11-10 Tom Tromey <tom@tromey.com>
+ * python/py-progspace.c (py_free_pspace): Use gdbpy_enter.
+
+2016-11-10 Tom Tromey <tom@tromey.com>
+
* python/py-objfile.c (py_free_objfile): Use gdbpy_enter.
2016-11-10 Tom Tromey <tom@tromey.com>
diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c
index 6fc53cb..26119c2 100644
--- a/gdb/python/py-progspace.c
+++ b/gdb/python/py-progspace.c
@@ -323,7 +323,6 @@ pspy_set_type_printers (PyObject *o, PyObject *value, void *ignore)
static void
py_free_pspace (struct program_space *pspace, void *datum)
{
- struct cleanup *cleanup;
pspace_object *object = (pspace_object *) datum;
/* This is a fiction, but we're in a nasty spot: The pspace is in the
process of being deleted, we can't rely on anything in it. Plus
@@ -336,10 +335,9 @@ py_free_pspace (struct program_space *pspace, void *datum)
being deleted. */
struct gdbarch *arch = target_gdbarch ();
- cleanup = ensure_python_env (arch, current_language);
+ gdbpy_enter enter_py (arch, current_language);
object->pspace = NULL;
Py_DECREF ((PyObject *) object);
- do_cleanups (cleanup);
}
/* Return a borrowed reference to the Python object of type Pspace
--
2.7.4