From: Alexey Lapshin <alexey.lapshin@espressif.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Alexey Gerenkov <alexey.gerenkov@espressif.com>,
Anton Maklakov <anton.maklakov@espressif.com>,
Ivan Grokhotkov <ivan@espressif.com>
Subject: [PATCH] gdb/python: initialize Python without signal handlers
Date: Wed, 9 Nov 2022 19:42:36 +0000 [thread overview]
Message-ID: <046071702889c1a0bb4fe33df605e865b5df571c.camel@espressif.com> (raw)
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
next reply other threads:[~2022-11-09 19:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 19:42 Alexey Lapshin [this message]
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
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=046071702889c1a0bb4fe33df605e865b5df571c.camel@espressif.com \
--to=alexey.lapshin@espressif.com \
--cc=alexey.gerenkov@espressif.com \
--cc=anton.maklakov@espressif.com \
--cc=gdb-patches@sourceware.org \
--cc=ivan@espressif.com \
/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).