From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14578 invoked by alias); 21 Sep 2012 15:55:06 -0000 Received: (qmail 14567 invoked by uid 22791); 21 Sep 2012 15:55:04 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Sep 2012 15:54:50 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TF5Z2-0004RY-VM from meador_inge@mentor.com ; Fri, 21 Sep 2012 08:54:48 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 21 Sep 2012 08:54:48 -0700 Received: from [172.30.8.47] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Fri, 21 Sep 2012 08:54:48 -0700 Message-ID: <505C8DC7.5090104@codesourcery.com> Date: Fri, 21 Sep 2012 15:55:00 -0000 From: Meador Inge User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120424 Thunderbird/12.0 MIME-Version: 1.0 To: Joel Brobecker CC: Subject: Re: Using Py_SetPythonHome References: <50511945.2070400@codesourcery.com> <20120917170657.GB5716@adacore.com> In-Reply-To: <20120917170657.GB5716@adacore.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00063.txt.bz2 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.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