This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 09/20] Use gdbpy_enter in py-type.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:36 -0700
- Subject: [RFA 09/20] Use gdbpy_enter in py-type.c
- Authentication-results: sourceware.org; auth=none
- References: <1478816387-27064-1-git-send-email-tom@tromey.com>
Change py-type.c to use gdbpy_enter.
2016-11-10 Tom Tromey <tom@tromey.com>
* python/py-type.c (save_objfile_types): Use gdbpy_enter.
---
gdb/ChangeLog | 4 ++++
gdb/python/py-type.c | 5 +----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e93e36b..9e2d08c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2016-11-10 Tom Tromey <tom@tromey.com>
+ * python/py-type.c (save_objfile_types): Use gdbpy_enter.
+
+2016-11-10 Tom Tromey <tom@tromey.com>
+
* python/python.c (gdbpy_eval_from_control_command)
(gdbpy_source_script, gdbpy_run_events)
(gdbpy_source_objfile_script, gdbpy_execute_objfile_script)
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index c832be9..ff1e4c4 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -1048,14 +1048,13 @@ save_objfile_types (struct objfile *objfile, void *datum)
{
type_object *obj = (type_object *) datum;
htab_t copied_types;
- struct cleanup *cleanup;
if (!gdb_python_initialized)
return;
/* This prevents another thread from freeing the objects we're
operating on. */
- cleanup = ensure_python_env (get_objfile_arch (objfile), current_language);
+ gdbpy_enter enter_py (get_objfile_arch (objfile), current_language);
copied_types = create_copied_types_hash (objfile);
@@ -1074,8 +1073,6 @@ save_objfile_types (struct objfile *objfile, void *datum)
}
htab_delete (copied_types);
-
- do_cleanups (cleanup);
}
static void
--
2.7.4