Salut à tous,

Je suis en train de déboguer une application Qt en ce moment, et plus particulièrement j'essaye de voir où il pourrait y avoir des fuites de mémoire.
J'utilise donc Valgrind.

Le problème que je rencontre est que Valgrind n'affiche pas les numéros de lignes.
Je sais qu'il faut compiler en mode debug (-g) et je le fais.
Je ne vois ce que je fais de mal

Voici la sortie de Valgrind pour une des erreurs (./ForceField est mon exécutable):
==42549== Conditional jump or move depends on uninitialised value(s)
==42549== at 0x10001162F: Point::inRange(Atom*) (in ./ForceField)
==42549== by 0x100011C9A: Point::updateAtoms() (in ./ForceField)
==42549== by 0x10001284B: PointGrid::update() (in ./ForceField)
==42549== by 0x100010623: Reactor::computeMoves(float) (in ./ForceField)
==42549== by 0x100007899: Simulator::run() (in ./ForceField)
==42549== by 0x100026423: QtSimulator::run() (in ./ForceField)
==42549== by 0x1000264DD: QtSimulator::run() (in ./ForceField)
==42549== by 0x100016830: MainWindow::step() (in ./ForceField)
==42549== by 0x10002867B: MainWindow::qt_metacall(QMetaObject::Call, int, void**) (in ./ForceField)
==42549== by 0x1017A7C67: QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) (in /opt/local/lib/libQtCore_debug.4.7.4.dylib)
==42549== by 0x1017AD0BA: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (in /opt/local/lib/libQtCore_debug.4.7.4.dylib)
==42549== by 0x1003664C0: QAction::triggered(bool) (in /opt/local/lib/libQtGui_debug.4.7.4.dylib)
==42549== Uninitialised value was created by a heap allocation
==42549== at 0x1000A9D7B: operator new(unsigned long) (vg_replace_malloc.c:261)
==42549== by 0x1000041AF: Loader::random(int, float, float) (in ./ForceField)
==42549== by 0x10000778C: Simulator::loadRandom() (in ./ForceField)
==42549== by 0x10002648A: QtSimulator::run() (in ./ForceField)
==42549== by 0x100016830: MainWindow::step() (in ./ForceField)
==42549== by 0x10002867B: MainWindow::qt_metacall(QMetaObject::Call, int, void**) (in ./ForceField)
==42549== by 0x1017A7C67: QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) (in /opt/local/lib/libQtCore_debug.4.7.4.dylib)
==42549== by 0x1017AD0BA: QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (in /opt/local/lib/libQtCore_debug.4.7.4.dylib)
==42549== by 0x1003664C0: QAction::triggered(bool) (in /opt/local/lib/libQtGui_debug.4.7.4.dylib)
==42549== by 0x100367FC9: QAction::activate(QAction::ActionEvent) (in /opt/local/lib/libQtGui_debug.4.7.4.dylib)
==42549== by 0x100368163: QAction::event(QEvent*) (in /opt/local/lib/libQtGui_debug.4.7.4.dylib)
==42549== by 0x10036FFA8: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /opt/local/lib/libQtGui_debug.4.7.4.dylib)


Comme vous pouvez le voir, aucun numéro de ligne.

Je lance Valgrind avec cette commande:
valgrind --tool=memcheck --leak-check=yes --track-origins=yes ./ForceField


Et voici les commandes utilisées lors de la compilation.
Je ne met les commandes que pour quelques types de fichiers (parce qu'ou sinon ce serait inutilement long).

Le formulaire .ui :

/opt/local/bin/uic forms/mainwindow.ui -o ui_mainwindow.h

Un fichier .cpp :

/usr/bin/g++-4.2 -c -pipe -fopenmp -Werror -O0 -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.6 -Wall -W -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -I/opt/local/include/QtOpenGL -I/opt/local/include/QtGui -I/opt/local/include/QtCore -I/opt/local/include -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -I. -o main.o main.cpp

Un fichier .moc :

/opt/local/bin/moc -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -I/opt/local/include/QtOpenGL -I/opt/local/include/QtGui -I/opt/local/include/QtCore -I/opt/local/include -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -I. -D__APPLE__ -D__GNUC__ view/QtSimulator.h -o moc_QtSimulator.cpp

/usr/bin/g++-4.2 -c -pipe -fopenmp -Werror -O0 -g -gdwarf-2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.6 -Wall -W -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/opt/local/share/qt4/mkspecs/macx-g++ -I. -I. -I/opt/local/include/QtOpenGL -I/opt/local/include/QtGui -I/opt/local/include/QtCore -I/opt/local/include -I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/System/Library/Frameworks/AGL.framework/Headers -I. -o moc_QtSimulator.o moc_QtSimulator.cpp

Et le linkage :

/usr/bin/g++-4.2 -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.6 -o ForceField.app/Contents/MacOS/ForceField main.o Loader.o Simulator.o Atom.o AtomFactory.o Resultant.o ForceFactory.o Force.o ForceElectrostatic.o Molecule.o MoleculeFactory.o Reactor.o Point.o PointGrid.o DirHandler.o MersenneTwister.o TimeHandler.o Tools.o QNamedCheckBox.o QtMainWindow.o QtPreviewer.o QtReactorDrawer.o QtSimulator.o QtReactorNative.o QtReactorOpenGl.o moc_QNamedCheckBox.o moc_QtMainWindow.o moc_QtPreviewer.o moc_QtReactorDrawer.o moc_QtSimulator.o -fopenmp -L/opt/local/lib -lQtOpenGL_debug -lQtGui_debug -lQtCore_debug -framework OpenGL -framework AGL

Comme vous pouvez le voir, le paramètre -g est bien appliqué.

Alors où est le problème ?
Merci,
Ibiz