Ъёхцхй!ххчьььллщр!тётёт! ц<br><br>----- Reply message -----<br>От: "S. Champailler" <schampailler@skynet.be><br>Кому: <pyside@lists.pyside.org><br>Тема: [PySide] Debug build of PySide and Python<br>Дата: вс, янв 22, 2012 20:25<br><br><br>Dear mailing list,<br><br>In case somebody needs this, here's what I've done this afternoon... I built my own PySide debug version. Which implies building a Python debug. Since I wanted to use valgrind, well, I had to build it too...<br><br>Unfortunately, this doesn't help much to figure out lost pointers (which happen when ownership is not properly handled...)<br><br>Anyway, I post it here...<br><br>Stefan<br><br><br><br><br>* Valgrind (bugged on Debian => I build it myself)<br><br>./configure --prefix=/home/stefan/Projects/valgrind<br>make<br>make install<br><br>export VALGRIND_LIB=/home/stefan/Projects/valgrind/lib/valgrind<br><br><br><br>* Python debug built with :<br><br>Download Python source then :<br><br>make clean<br>./configure --without-pymalloc --with-valgrind --with-pydebug --enable-shared --prefix=/home/stefan/Projects/python-valgrind --enable-unicode=ucs4<br>make<br>make install<br><br>Note the --enable-unicode, somehow it was hard to figure out...<br>I'm also thinking that --with-valgrind implies --without-pymalloc...<br><br><br>* PySide debug built with :<br><br>export PYTHONBASE=$HOME/Projects/python-valgrind<br>export PYSIDESANDBOXPATH=$HOME/Projects/PL/pyside-valgrind<br><br># Tell cmake to use our Python debug build<br><br>export PYTHON_EXEC=$PYTHONBASE/bin/python<br>export PYTHON_LIB=$PYTHONBASE/lib<br>export PYTHON_INC=$PYTHONBASE/include<br>export PYTHONPATH=$PYSIDESANDBOXPATH/lib/python2.7/site-packages:$PYTHONBASE<br><br>export PATH=$PYSIDESANDBOXPATH/bin:$PATH<br>export LD_LIBRARY_PATH=$PYSIDESANDBOXPATH/lib:$PYTHONBASE/lib<br><br>#I guess the following is for the build only<br>export PKG_CONFIG_PATH=$PYSIDESANDBOXPATH/lib/pkgconfig:$PKG_CONFIG_PATH<br># set -DENABLE_ICECC=1 if you're using the icecream distributed compiler<br>alias runcmake='cmake .. -DCMAKE_INSTALL_PREFIX=$PYSIDESANDBOXPATH -DCMAKE_BUILD_TYPE=Debug -DENABLE_ICECC=0'<br><br>and, as explianed on the wiki, but extended for the prupose of a debug build (so I've added a few var. definitions -D):<br><br>    cmake .. -DCMAKE_INSTALL_PREFIX=$PYSIDESANDBOXPATH -DCMAKE_BUILD_TYPE=Debug -DENABLE_ICECC=0 -DPYTHON_EXECUTABLE:PATH=$PYTHON_EXEC -DPYTHON_INCLUDE_DIRS:PATH=$PYT\<br>HON_INC -DPYTHON_LIBRARY:FILEPATH=$PYTHON_LIB/libpython2.7.so  && make -j4 && make install<br><br>... on all the directories of PySide ("apiextractor" "generatorrunner" "shiboken" "pyside")<br><br>See the scripts proposed on  : http://developer.qt.nokia.com/wiki/Building_PySide_on_Linux<br>They were my starting point.<br><br><br>* Running in Valgrind :<br><br>/home/stefan/Projects/valgrind/bin/valgrind --tool=memcheck /home/stefan/Projects/python-valgrind/bin/python python.py<br><br><br>* Debug with gdb :<br><br>export LD_LIBRARY_PATH= # This makes gdb mad, will have to redefine it in gdb environment, see below<br>gdb /home/stefan/Projects/python-valgrind/bin/python<br><br>and once in gdb :<br><br>(gdb) set environment LD_LIBRARY_PATH=/home/stefan/Projects/PL/pyside-valgrind/lib:/home/stefan/Projects/python-valgrind/lib<br>(gdb) r python.py<br><br><br><br><br>_______________________________________________<br>PySide mailing list<br>PySide@lists.pyside.org<br>http://lists.pyside.org/listinfo/pyside<br>