[lldb-dev] Compiling lldb with Python2.6

Greg Clayton gclayton at apple.com
Thu Feb 16 19:04:59 PST 2012


comments below
On Feb 16, 2012, at 11:44 AM, Filipe Cabecinhas wrote:

> Hello everyone, 
> 
> Is it possible to build the python bindings with python 2.6 instead of 2.7 (on Lion)?
> 
> I tried setting the com.apple.versioner.python key "Version = 2.6" and changing the symlink in /System/Library/Frameworks/Python.framework/Versions/Current to the 2.6 version.
> 
> With those changes, the framework got built and I can import the module without any errors. I can also use lldb's functions, at least with HandleCommand() and the tutorials that are in the source base.
> 
> My problem is that everything is good if I don't run any program. If I try to use the 'run' command, or the target.LaunchSimple () method, the lldb library errors out with "Process must be launched" for commands like "bt", "n", "list".
> 
> The state is stuck at "launching", and I get the child program in an "uninterruptible sleep state" ('U' in ps).
> 
> I wanted to use the Python bindings with 2.6 because they would be called from a program that is compatible with Snow Leopard and Lion, so we can't be sure we will have python 2.7.
> 
> Any ideas on what went wrong or how to fix this problem?

You will need to attach to the python program while it is running with the LLDB Xcode project. To do this, just run your python script and make sure it is using the debug version of the LLDB.framework that you have built. Then in Xcode attach to the python process. With Xcode 4, just use the Product->Attach to Process->Python. Then set a breakpoint in SBTarget.cpp in the LaunchSimple command and you can step through and see what is wrong. You can repeat with a fresh copy of the LLDB sources that use Python 2.7 and see what changed.

You might also check the SWIG files and the scripts that generate the SWIG C/C++ to Python binding and make sure they aren't outputting files that targetting python 2.7.



More information about the lldb-dev mailing list