[PATCH v1 12/13] script language API for GDB: preserve_values changes

xdje42@gmail.com xdje42@gmail.com
Fri Dec 6 05:53:00 GMT 2013


This patch contains the changes for preserving values.
They're pretty simple and straightforward.

2013-12-05  Doug Evans  <xdje42@gmail.com>

	* value.c (preserve_values): Update to call preserve_script_values.
	* python/py-value.c: Remove #ifdef HAVE_PYTHON.
	(gdbpy_preserve_values): Renamed from preserve_python_values.
	New arg slang.
	(!HAVE_PYTHON, preserve_python_values): Delete.

diff --git a/gdb/value.c b/gdb/value.c
index a64e7e1..7e3357a 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -2266,7 +2266,7 @@ preserve_values (struct objfile *objfile)
   for (var = internalvars; var; var = var->next)
     preserve_one_internalvar (var, objfile, copied_types);
 
-  preserve_python_values (objfile, copied_types);
+  preserve_script_values (objfile, copied_types);
 
   htab_delete (copied_types);
 }
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 40254b9..de0f764 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -30,8 +30,6 @@
 #include "cp-abi.h"
 #include "python.h"
 
-#ifdef HAVE_PYTHON
-
 #include "python-internal.h"
 
 /* Even though Python scalar types directly map to host types, we use
@@ -163,7 +161,8 @@ valpy_new (PyTypeObject *subtype, PyObject *args, PyObject *keywords)
 /* Iterate over all the Value objects, calling preserve_one_value on
    each.  */
 void
-preserve_python_values (struct objfile *objfile, htab_t copied_types)
+gdbpy_preserve_values (const struct script_language_defn *slang,
+		       struct objfile *objfile, htab_t copied_types)
 {
   value_object *iter;
 
@@ -1530,13 +1529,3 @@ PyTypeObject value_object_type = {
   0,				  /* tp_alloc */
   valpy_new			  /* tp_new */
 };
-
-#else
-
-void
-preserve_python_values (struct objfile *objfile, htab_t copied_types)
-{
-  /* Nothing.  */
-}
-
-#endif /* HAVE_PYTHON */



More information about the Gdb-patches mailing list