This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using Py_SetPythonHome


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]