public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Meador Inge <meadori@codesourcery.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: <gdb@sourceware.org>
Subject: Re: Using Py_SetPythonHome
Date: Fri, 21 Sep 2012 15:55:00 -0000	[thread overview]
Message-ID: <505C8DC7.5090104@codesourcery.com> (raw)
In-Reply-To: <20120917170657.GB5716@adacore.com>

On 09/17/2012 12:06 PM, Joel Brobecker wrote:

>> 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).
> 
> Not sure what (2) and (3) are...

We distribute the toolchain with a layout that looks like:

   bin/
      $cross-gdb
   lib/
      libpython2.6.so.1.0
      python2.6/
      python26.zip

Py_Initialize and the Python import machinery can handle a zipped standard
library if the the python<major><minor>.zip naming convention is followed.
However, we don't ship the actual python executable, thus the system paths
aren't computed correctly unless Py_SetPythonHome is called (hence the patch).

This is why I moved Py_SetPythonHome before Py_Initialize in my patch.

>> 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
> 
> ... The proposed patch has been working flawlessly for us since
> I installed it in AdaCore's tree, but as far as I know, there has
> been no change of heart regarding its inclusion in the FSF tree.
> I believe Jan contacted the Python developers, and their answer
> seemed to go in Jan's direction.

Hmmm, I missed that issue on python-bugs.  I will follow up on the Python side
in the Python tracker.

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

  parent reply	other threads:[~2012-09-21 15:55 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 23:23 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 [this message]
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=505C8DC7.5090104@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).