This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Use gdbpy_enter in py-objfile.c


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2d38bcedc2f91692857d257e106dafc9269d8f1a

commit 2d38bcedc2f91692857d257e106dafc9269d8f1a
Author: Tom Tromey <tom@tromey.com>
Date:   Mon Nov 7 16:07:53 2016 -0700

    Use gdbpy_enter in py-objfile.c
    
    Change py-objfile.c to use gdbpy_enter.
    
    2017-01-10  Tom Tromey  <tom@tromey.com>
    
    	* python/py-objfile.c (py_free_objfile): Use gdbpy_enter.

Diff:
---
 gdb/ChangeLog           | 4 ++++
 gdb/python/py-objfile.c | 4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d3f7b05..9062025 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2017-01-10  Tom Tromey  <tom@tromey.com>
 
+	* python/py-objfile.c (py_free_objfile): Use gdbpy_enter.
+
+2017-01-10  Tom Tromey  <tom@tromey.com>
+
 	* python/py-inferior.c (python_on_normal_stop, python_on_resume)
 	(python_on_inferior_call_pre, python_on_inferior_call_post)
 	(python_on_memory_change, python_on_register_change)
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
index 2585f62..8ac93f9 100644
--- a/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
@@ -612,13 +612,11 @@ gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw)
 static void
 py_free_objfile (struct objfile *objfile, void *datum)
 {
-  struct cleanup *cleanup;
   objfile_object *object = (objfile_object *) datum;
 
-  cleanup = ensure_python_env (get_objfile_arch (objfile), current_language);
+  gdbpy_enter enter_py (get_objfile_arch (objfile), current_language);
   object->objfile = NULL;
   Py_DECREF ((PyObject *) object);
-  do_cleanups (cleanup);
 }
 
 /* Return a borrowed reference to the Python object of type Objfile


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]