mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-15 05:01:13 +08:00
Make array object extern
Compiling python.c in C++ mode, we get: ...src/gdb/python/python.c: At global scope: ...src/gdb/python/python.c:106:31: error: storage size of ‘GdbMethods’ isn’t known static PyMethodDef GdbMethods[]; ^ Fix it by making the affected array objects extern. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * python/python.c (GdbMethods): Rename to ... (python_GdbMethods): ... this and make extern. (GdbModuleDef): Rename to ... (python_GdbModuleDef): ... this and make extern.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* python/python.c (GdbMethods): Rename to ...
|
||||||
|
(python_GdbMethods): ... this and make extern.
|
||||||
|
(GdbModuleDef): Rename to ...
|
||||||
|
(python_GdbModuleDef): ... this and make extern.
|
||||||
|
|
||||||
2015-02-27 Pedro Alves <palves@redhat.com>
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* record-btrace.c (set_record_btrace_cmdlist)
|
* record-btrace.c (set_record_btrace_cmdlist)
|
||||||
|
@ -103,10 +103,10 @@ const struct extension_language_defn extension_language_python =
|
|||||||
|
|
||||||
int gdb_python_initialized;
|
int gdb_python_initialized;
|
||||||
|
|
||||||
static PyMethodDef GdbMethods[];
|
extern PyMethodDef python_GdbMethods[];
|
||||||
|
|
||||||
#ifdef IS_PY3K
|
#ifdef IS_PY3K
|
||||||
static struct PyModuleDef GdbModuleDef;
|
extern struct PyModuleDef python_GdbModuleDef;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PyObject *gdb_module;
|
PyObject *gdb_module;
|
||||||
@ -1712,11 +1712,11 @@ message == an error message without a stack will be printed."),
|
|||||||
PyEval_InitThreads ();
|
PyEval_InitThreads ();
|
||||||
|
|
||||||
#ifdef IS_PY3K
|
#ifdef IS_PY3K
|
||||||
gdb_module = PyModule_Create (&GdbModuleDef);
|
gdb_module = PyModule_Create (&python_GdbModuleDef);
|
||||||
/* Add _gdb module to the list of known built-in modules. */
|
/* Add _gdb module to the list of known built-in modules. */
|
||||||
_PyImport_FixupBuiltin (gdb_module, "_gdb");
|
_PyImport_FixupBuiltin (gdb_module, "_gdb");
|
||||||
#else
|
#else
|
||||||
gdb_module = Py_InitModule ("_gdb", GdbMethods);
|
gdb_module = Py_InitModule ("_gdb", python_GdbMethods);
|
||||||
#endif
|
#endif
|
||||||
if (gdb_module == NULL)
|
if (gdb_module == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -1932,7 +1932,7 @@ gdbpy_initialized (const struct extension_language_defn *extlang)
|
|||||||
|
|
||||||
#ifdef HAVE_PYTHON
|
#ifdef HAVE_PYTHON
|
||||||
|
|
||||||
static PyMethodDef GdbMethods[] =
|
PyMethodDef python_GdbMethods[] =
|
||||||
{
|
{
|
||||||
{ "history", gdbpy_history, METH_VARARGS,
|
{ "history", gdbpy_history, METH_VARARGS,
|
||||||
"Get a value from history" },
|
"Get a value from history" },
|
||||||
@ -2044,7 +2044,7 @@ Return a tuple containing all inferiors." },
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef IS_PY3K
|
#ifdef IS_PY3K
|
||||||
static struct PyModuleDef GdbModuleDef =
|
struct PyModuleDef python_GdbModuleDef =
|
||||||
{
|
{
|
||||||
PyModuleDef_HEAD_INIT,
|
PyModuleDef_HEAD_INIT,
|
||||||
"_gdb",
|
"_gdb",
|
||||||
|
Reference in New Issue
Block a user