public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Fix _gdb registration
@ 2022-06-03 16:54 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-06-03 16:54 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Currently, the _gdb module is only registered when WITH_PYTHON_PATH is
defined.  This seems wrong to me, though I don't know how to test it
-- does anyone build gdb without WITH_PYTHON_PATH, and can that even
work?

This patch shows the change I think should be made.  Alternatively, we
could just remove WITH_PYTHON_PATH entirely.
---
 gdb/python/python.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/python/python.c b/gdb/python/python.c
index 9bef2252e88..e3ad431671e 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -2000,10 +2000,10 @@ do_start_initialization ()
      remain alive for the duration of the program's execution, so
      it is not freed after this call.  */
   Py_SetProgramName (progname_copy);
+#endif
 
   /* Define _gdb as a built-in module.  */
   PyImport_AppendInittab ("_gdb", init__gdb_module);
-#endif
 
   Py_Initialize ();
 #if PY_VERSION_HEX < 0x03090000
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-03 16:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 16:54 [RFC] Fix _gdb registration Tom Tromey

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).