aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-10-25 17:25:45 +0100
committerAndrew Burgess <aburgess@redhat.com>2021-11-25 10:07:15 +0000
commitc6a6aad52d9e839d6a84ac31cabe2b7e1a2a31a0 (patch)
treecdbb63c1e4482fe8d6a74ca488b8dc82abc4d8c5 /gdb/python/python.c
parent32b1f5e8d6b8ddd3be6e471c26dd85a1dac31dda (diff)
downloadbinutils-c6a6aad52d9e839d6a84ac31cabe2b7e1a2a31a0.zip
binutils-c6a6aad52d9e839d6a84ac31cabe2b7e1a2a31a0.tar.gz
binutils-c6a6aad52d9e839d6a84ac31cabe2b7e1a2a31a0.tar.bz2
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.
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r--gdb/python/python.c53
1 files changed, 24 insertions, 29 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 593fbc1..d8a6a59 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -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;