This is the mail archive of the gdb-patches@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]

[RFA 08/11] Remove ensure_python_env


All of gdb has been converted away from ensure_python_env and
varobj_ensure_python_env now; so remove them.

2016-11-12  Tom Tromey  <tom@tromey.com>

	* python/python.c (ensure_python_env, restore_python_env):
	Remove.
	* python/python-internal.h (ensure_python_env): Don't declare.
	* varobj.h (varobj_ensure_python_env): Don't declare.
	* varobj.c (varobj_ensure_python_env): Remove.
---
 gdb/ChangeLog                |  8 ++++++++
 gdb/python/python-internal.h |  3 ---
 gdb/python/python.c          | 23 -----------------------
 gdb/varobj.c                 |  8 --------
 gdb/varobj.h                 |  2 --
 5 files changed, 8 insertions(+), 36 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index be7ce38..760bb9c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
 2016-11-12  Tom Tromey  <tom@tromey.com>
 
+	* python/python.c (ensure_python_env, restore_python_env):
+	Remove.
+	* python/python-internal.h (ensure_python_env): Don't declare.
+	* varobj.h (varobj_ensure_python_env): Don't declare.
+	* varobj.c (varobj_ensure_python_env): Remove.
+
+2016-11-12  Tom Tromey  <tom@tromey.com>
+
 	* varobj.c (varobj_value_get_print_value): Use
 	gdbpy_enter_varobj.
 
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index d167251..fdbff30 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -535,9 +535,6 @@ class gdbpy_enter_varobj : public gdbpy_enter
 
 };
 
-struct cleanup *ensure_python_env (struct gdbarch *gdbarch,
-				   const struct language_defn *language);
-
 extern struct gdbarch *python_gdbarch;
 extern const struct language_defn *python_language;
 
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 59fa9e1..2bfe67f 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -241,29 +241,6 @@ gdbpy_enter::~gdbpy_enter ()
   restore_active_ext_lang (m_previous_active);
 }
 
-static void
-restore_python_env (void *p)
-{
-  gdbpy_enter *env = (gdbpy_enter *) p;
-
-  delete env;
-}
-
-/* Called before entering the Python interpreter to install the
-   current language and architecture to be used for Python values.
-   Also set the active extension language for GDB so that SIGINT's
-   are directed our way, and if necessary install the right SIGINT
-   handler.  */
-
-struct cleanup *
-ensure_python_env (struct gdbarch *gdbarch,
-                   const struct language_defn *language)
-{
-  gdbpy_enter *env = new gdbpy_enter (gdbarch, language);
-
-  return make_cleanup (restore_python_env, env);
-}
-
 /* Set the quit flag.  */
 
 static void
diff --git a/gdb/varobj.c b/gdb/varobj.c
index deebe08..4580b87 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -226,14 +226,6 @@ is_root_p (const struct varobj *var)
 }
 
 #ifdef HAVE_PYTHON
-/* Helper function to install a Python environment suitable for
-   use during operations on VAR.  */
-struct cleanup *
-varobj_ensure_python_env (const struct varobj *var)
-{
-  return ensure_python_env (var->root->exp->gdbarch,
-			    var->root->exp->language_defn);
-}
 
 /* See python-internal.h.  */
 gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
diff --git a/gdb/varobj.h b/gdb/varobj.h
index df5c6cb..3ecf071 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -320,8 +320,6 @@ extern int varobj_has_more (const struct varobj *var, int to);
 
 extern int varobj_is_dynamic_p (const struct varobj *var);
 
-extern struct cleanup *varobj_ensure_python_env (const struct varobj *var);
-
 extern int varobj_default_value_is_changeable_p (const struct varobj *var);
 extern int varobj_value_is_changeable_p (const struct varobj *var);
 
-- 
2.7.4


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