public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/python: initialize Python without signal handlers
@ 2022-11-09 19:42 Alexey Lapshin
  2022-11-09 20:12 ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Lapshin @ 2022-11-09 19:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Alexey Gerenkov, Anton Maklakov, Ivan Grokhotkov

Fix embedded Python initialization.
Installing signal handlers on Windows GDB builds might lead to issues
---
 gdb/python/python.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gdb/python/python.c b/gdb/python/python.c
index 29f2010ee8e..833eedd35f9 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -2050,7 +2050,7 @@ 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);
-  Py_Initialize ();
+  Py_InitializeEx (0);
 #else
   PyConfig config;
 
@@ -2062,6 +2062,7 @@ do_start_initialization ()
 
   config.write_bytecode = python_write_bytecode ();
   config.use_environment = !python_ignore_environment;
+  config.install_signal_handlers = 0;
 
   status = PyConfig_Read (&config);
   if (PyStatus_Exception (status))
@@ -2075,7 +2076,7 @@ do_start_initialization ()
     return false;
 #endif
 #else
-  Py_Initialize ();
+  Py_InitializeEx (0);
 #endif
 
 #if PY_VERSION_HEX < 0x03090000
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-21 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 19:42 [PATCH] gdb/python: initialize Python without signal handlers Alexey Lapshin
2022-11-09 20:12 ` Tom Tromey
2022-11-09 20:40   ` Alexey Lapshin
2022-12-20 20:24     ` Tom Tromey
2022-12-21 16:12       ` Alexey Lapshin

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