This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v4 12/16] extension language API for GDB: preserve_values changes
- From: Doug Evans <xdje42 at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 15 Jan 2014 11:25:45 -0800
- Subject: [PATCH v4 12/16] extension 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 v2:
- in value.c, replace #include "python/python.h" with "extension.h"
Changes from v1:
- updates for scripting -> extension renaming
2014-01-15 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 8542316..0a895ca 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -38,7 +38,7 @@
#include "valprint.h"
#include "cli/cli-decode.h"
#include "exceptions.h"
-#include "python/python.h"
+#include "extension.h"
#include <ctype.h>
#include "tracepoint.h"
#include "cp-abi.h"
@@ -2405,7 +2405,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 65750a4..a047e90 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;
@@ -1704,13 +1703,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 */