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