summaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/python-internal.h1
-rw-r--r--gdb/python/python.c10
2 files changed, 9 insertions, 2 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 07650f73236..38063226459 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -21,6 +21,7 @@
#define GDB_PYTHON_INTERNAL_H
#include "extension.h"
+#include "extension-priv.h"
/* These WITH_* macros are defined by the CPython API checker that
comes with the Python plugin for GCC. See:
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 05df234322b..073d7c57b65 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -105,7 +105,7 @@ const struct extension_language_defn extension_language_python =
int gdb_python_initialized;
-static PyMethodDef GdbMethods[];
+static PyMethodDef *get_GdbMethods (void);
#ifdef IS_PY3K
static struct PyModuleDef GdbModuleDef;
@@ -1684,7 +1684,7 @@ message == an error message without a stack will be printed."),
/* Add _gdb module to the list of known built-in modules. */
_PyImport_FixupBuiltin (gdb_module, "_gdb");
#else
- gdb_module = Py_InitModule ("_gdb", GdbMethods);
+ gdb_module = Py_InitModule ("_gdb", get_GdbMethods());
#endif
if (gdb_module == NULL)
goto fail;
@@ -1997,6 +1997,12 @@ Return a tuple containing all inferiors." },
{NULL, NULL, 0, NULL}
};
+static PyMethodDef *
+get_GdbMethods (void)
+{
+ return GdbMethods;
+}
+
#ifdef IS_PY3K
static struct PyModuleDef GdbModuleDef =
{