From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/4] gdb/python: make some global variables static
Date: Tue, 26 Oct 2021 10:37:56 +0100 [thread overview]
Message-ID: <666b1efbde4e68a870a448a921e4c0d3746a8d1b.1635241044.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1635241044.git.andrew.burgess@embecosm.com>
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.
---
gdb/python/python.c | 53 ++++++++++++++++++++-------------------------
1 file changed, 24 insertions(+), 29 deletions(-)
diff --git a/gdb/python/python.c b/gdb/python/python.c
index c81814c557b..c7b5e7faa8e 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
-};
\f
#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;
--
2.25.4
next prev parent reply other threads:[~2021-10-26 9:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 9:37 [PATCH 0/4] Disassembler Output Styling Andrew Burgess
2021-10-26 9:37 ` Andrew Burgess [this message]
2021-10-27 20:20 ` [PATCH 1/4] gdb/python: make some global variables static Tom Tromey
2021-11-25 10:12 ` Andrew Burgess
2021-11-25 15:02 ` Enze Li
2021-11-25 18:11 ` Andrew Burgess
2021-10-26 9:37 ` [PATCH 2/4] gdb: rename source_styling_changed observer Andrew Burgess
2021-10-27 20:22 ` Tom Tromey
2021-11-25 10:17 ` Andrew Burgess
2021-10-26 9:37 ` [PATCH 3/4] gdb: use python to colorize disassembler output Andrew Burgess
2021-10-27 20:38 ` Tom Tromey
2021-10-28 16:28 ` Andrew Burgess
2021-11-22 14:44 ` Andrew Burgess
2021-10-26 9:37 ` [PATCH 4/4] gdb/python: move styling support to gdb.styling Andrew Burgess
2021-10-27 20:39 ` Tom Tromey
2021-11-25 10:36 ` [PATCHv2 0/2] Disassembler Output Styling Andrew Burgess
2021-11-25 10:36 ` [PATCHv2 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2021-11-25 11:04 ` Eli Zaretskii
2021-11-25 10:36 ` [PATCHv2 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2021-12-06 14:32 ` Ping: [PATCHv2 0/2] Disassembler Output Styling Andrew Burgess
2021-12-13 14:12 ` [PATCHv3 " Andrew Burgess
2021-12-13 14:12 ` [PATCHv3 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2021-12-13 14:12 ` [PATCHv3 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-01-11 14:30 ` [PATCHv4 0/2] Disassembler Output Styling Andrew Burgess
2022-01-11 14:31 ` [PATCHv4 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2022-02-10 21:13 ` Tom Tromey
2022-02-11 14:27 ` Andrew Burgess
2022-02-13 18:02 ` Tom Tromey
2022-02-14 11:22 ` Andrew Burgess
2022-01-11 14:31 ` [PATCHv4 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-02-10 21:15 ` Tom Tromey
2022-02-10 21:16 ` Tom Tromey
2022-01-21 16:26 ` [PATCHv5 0/2] Disassembler Output Styling Andrew Burgess
2022-01-21 16:26 ` [PATCHv5 1/2] gdb: use python to colorize disassembler output Andrew Burgess
2022-01-21 16:26 ` [PATCHv5 2/2] gdb/python: move styling support to gdb.styling Andrew Burgess
2022-02-03 20:32 ` [PATCHv5 0/2] Disassembler Output Styling Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=666b1efbde4e68a870a448a921e4c0d3746a8d1b.1635241044.git.andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).