gdb/python: make some global variables static

Make a couple of global variables static in python/python.c.  To do
this I had to move the definition of extension_language_python to
later in the file.

There should be no user visible changes after this commit.
This commit is contained in:
Andrew Burgess 2021-10-25 17:25:45 +01:00 committed by Andrew Burgess
parent 32b1f5e8d6
commit c6a6aad52d

View file

@ -58,33 +58,6 @@ static const char *const python_excp_enums[] =
the default. */
static const char *gdbpy_should_print_stack = python_excp_message;
#ifdef HAVE_PYTHON
/* Forward decls, these are defined later. */
extern const struct extension_language_script_ops python_extension_script_ops;
extern const struct extension_language_ops python_extension_ops;
#endif
/* The main struct describing GDB's interface to the Python
extension language. */
const struct extension_language_defn extension_language_python =
{
EXT_LANG_PYTHON,
"python",
"Python",
".py",
"-gdb.py",
python_control,
#ifdef HAVE_PYTHON
&python_extension_script_ops,
&python_extension_ops
#else
NULL,
NULL
#endif
};
#ifdef HAVE_PYTHON
@ -151,7 +124,7 @@ static gdb::optional<std::string> gdbpy_colorize
/* The interface between gdb proper and loading of python scripts. */
const struct extension_language_script_ops python_extension_script_ops =
static const struct extension_language_script_ops python_extension_script_ops =
{
gdbpy_source_script,
gdbpy_source_objfile_script,
@ -161,7 +134,7 @@ const struct extension_language_script_ops python_extension_script_ops =
/* The interface between gdb proper and python extensions. */
const struct extension_language_ops python_extension_ops =
static const struct extension_language_ops python_extension_ops =
{
gdbpy_initialize,
gdbpy_initialized,
@ -191,6 +164,28 @@ const struct extension_language_ops python_extension_ops =
gdbpy_colorize,
};
/* The main struct describing GDB's interface to the Python
extension language. */
const struct extension_language_defn extension_language_python =
{
EXT_LANG_PYTHON,
"python",
"Python",
".py",
"-gdb.py",
python_control,
#ifdef HAVE_PYTHON
&python_extension_script_ops,
&python_extension_ops
#else
NULL,
NULL
#endif
};
/* Architecture and language to be used in callbacks from
the Python interpreter. */
struct gdbarch *python_gdbarch;