public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Using Py_SetPythonHome
@ 2012-09-12 23:23 Meador Inge
  2012-09-17 17:07 ` Joel Brobecker
  0 siblings, 1 reply; 32+ messages in thread
From: Meador Inge @ 2012-09-12 23:23 UTC (permalink / raw)
  To: gdb; +Cc: brobecker

Hi All,

I noticed in Nov 2010 Joel proposed adding a call to Py_SetPythonHome in this
thread [1].  However, it seems that got dropped.  I would like to bring this
topic up again.

The use case I am having trouble with is the one where gdb gets shipped with:
(1) its own pythonxy.so, (2) a zipped standard library, and (3) a directory for
the standard library module shared libraries.  In this case, Py_SetPythonHome
needs to be called before Py_Initialize so that the standard library pieces can
even be found (Py_Initialize does some imports).

So, I was playing around with something like what Joel proposed, but before
Py_Initiliaze:


diff --git a/gdb/python/python.c b/gdb/python/python.c
index 482f53e..fa86e61 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1353,6 +1353,7 @@ message == an error message without a stack will be printe
      This must be done before calling Py_Initialize.  */
   Py_SetProgramName (concat (ldirname (python_libdir), SLASH_STRING, "bin",
                             SLASH_STRING, "python", NULL));
+  Py_SetPythonHome (ldirname (python_libdir));
 #endif

   Py_Initialize ();


Is there another way around the problem I am having?  Have the feelings
concerning Py_SetPythonHome changed since comments in [1] ?

[1] http://sources.redhat.com/ml/gdb-patches/2010-11/msg00328.html

-- 
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software

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

end of thread, other threads:[~2012-10-11 14:54 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-12 23:23 Using Py_SetPythonHome Meador Inge
2012-09-17 17:07 ` Joel Brobecker
2012-09-17 17:46   ` Jan Kratochvil
2012-09-18 19:38     ` Doug Evans
2012-09-19  8:04       ` Jan Kratochvil
2012-09-21 15:37         ` Joel Brobecker
2012-09-21 15:44           ` Jan Kratochvil
2012-09-21 15:58             ` Joel Brobecker
2012-09-21 17:28               ` Jan Kratochvil
2012-10-02 13:09                 ` Joel Brobecker
2012-10-03 15:13                   ` Jan Kratochvil
2012-10-03 15:14                     ` Jan Kratochvil
2012-10-03 15:39                     ` Joel Brobecker
2012-10-03 17:44                       ` Eli Zaretskii
2012-10-03 17:54                       ` Jan Kratochvil
2012-10-03 17:57                         ` Paul_Koning
2012-10-03 18:35                           ` Eli Zaretskii
2012-10-03 18:43                             ` Jan Kratochvil
2012-10-03 18:52                               ` Eli Zaretskii
2012-10-03 19:03                                 ` Jan Kratochvil
2012-10-03 19:10                                   ` Eli Zaretskii
2012-10-03 19:54                               ` Paul_Koning
2012-10-03 20:04                                 ` Jan Kratochvil
2012-10-03 20:11                               ` Alfred M. Szmidt
2012-10-03 18:40                         ` Eli Zaretskii
2012-10-03 19:26                         ` Terekhov, Mikhail
2012-10-04  7:33                         ` John Gilmore
2012-10-11  8:42                           ` Jan Kratochvil
2012-10-11 14:54                             ` Doug Evans
2012-09-21 15:55   ` Meador Inge
2012-09-21 16:01     ` Jan Kratochvil
2012-09-21 16:36       ` Doug Evans

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