This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 12/13] script language API for GDB: preserve_values changes
- From: Doug Evans <xdje42 at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 10 Dec 2013 21:11:16 -0800
- Subject: [PATCH v2 12/13] script language API for GDB: preserve_values changes
- Authentication-results: sourceware.org; auth=none
This patch contains the changes for preserving values.
They're pretty simple and straightforward.
Changes from v1:
- updates for scripting -> extension renaming
2013-12-10 Doug Evans <xdje42@gmail.com>
* value.c (preserve_values): Update to call preserve_ext_lang_values.
* python/py-value.c: Remove #ifdef HAVE_PYTHON.
(gdbpy_preserve_values): Renamed from preserve_python_values.
New arg extlang.
(!HAVE_PYTHON, preserve_python_values): Delete.
diff --git a/gdb/value.c b/gdb/value.c
index a64e7e1..7f3e286 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_ext_lang_values (objfile, copied_types);
htab_delete (copied_types);
}
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 40254b9..8f09f0a 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 extension_language_defn *extlang,
+ 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 */