Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Meador Inge <meadori@codesourcery.com>
To: <gdb@sourceware.org>
Cc: <brobecker@adacore.com>
Subject: Using Py_SetPythonHome
Date: Wed, 12 Sep 2012 23:23:00 -0000	[thread overview]
Message-ID: <50511945.2070400@codesourcery.com> (raw)

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


             reply	other threads:[~2012-09-12 23:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 23:23 Meador Inge [this message]
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

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=50511945.2070400@codesourcery.com \
    --to=meadori@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@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