PDA

View Full Version : Debug QT4 Gui Application



cae
21st November 2009, 11:42
Hi, i created an empty project (it only has a mainwindow invoqued on main.cpp) but i'm not able to debug it, the code of the main.cpp looks like this:

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}


But it stops at the QApplication a(argc, argv); line.

And the message: Stopped: "signal-received"

But when i decide to build a release and run it, it works without any problem :eek:

Can any one help me?

wysota
21st November 2009, 11:52
What stops? What signal is received?

cae
21st November 2009, 12:13
it doesnt say anything else, i leave here an screenshot of what happens

http://www.megaupload.com/?d=Q3RM3RM6

wysota
21st November 2009, 12:17
Sorry I can't download the file. Attach the screenshot to your post instead of using 3rd party sites for linking images.

cae
21st November 2009, 12:28
http://img242.imageshack.us/img242/2293/screenen.png

http://yfrog.com/6qscreenenp
sorry :o

wysota
21st November 2009, 13:17
You have set a breakpoint on the line so it stops there. Isn't it what you expected?

By the way, next time please at least provide info that you are debugging using Qt Creator on Windows.

cae
22nd November 2009, 10:55
Yes, i setted the breakpoint there to make sure it stopped on that line.... is when i step over that function when the debbug ends...

any idea?

QT Creator 1.2.1 and QT 4.5.3 on Windows XP SP3 :)

wysota
22nd November 2009, 11:24
What happens if you don't put that breakpoint there?

cae
22nd November 2009, 12:25
same message, but i wouldent be able to know where is stopping :(

i'm sure there has to be something wrong with the configuration because the program i'm trying to compile its clean, and made up by QT Creator....

I checked Tools->Options and i haddnt installed the Cdb, i did it, and now i get a diferent message.... "Debugging helpers not found" (not bad)

I went to Debugging helper tab and i have this path:
C:\Qt\lib\qtcreator\DebuggingHelper.dll

For GDB:
C:\Qt\mingw\bin\gdb.exe

And CDB:
C:\Archivos de programa\Debugging Tools For Windows (x86)

Finally i went to QT Versions and i rebuilt the debugging helper (or that is what i beleave):

http://www.imagechicken.com/uploads/1258896836051189100.jpg

I'm sure it has something to do with this stuff......

cae
22nd November 2009, 12:39
This is the log after rebuilding Debugging helper:

Building debugging helper library in C:/Qt/qt/qtc-debugging-helper/

Running C:/Qt/mingw/bin/mingw32-make.exe clean...
C:/Qt/mingw/bin/mingw32-make -f Makefile.Debug clean
mingw32-make[1]: Entering directory `C:/Qt/qt/qtc-debugging-helper'
rm debug/gdbmacros.o
rm debug/libgdbmacros.a
mingw32-make[1]: Leaving directory `C:/Qt/qt/qtc-debugging-helper'
C:/Qt/mingw/bin/mingw32-make -f Makefile.Release clean
mingw32-make[1]: Entering directory `C:/Qt/qt/qtc-debugging-helper'
rm release/gdbmacros.o
rm: cannot remove `release/gdbmacros.o': No such file or directory
mingw32-make[1]: [clean] Error 1 (ignored)
rm release/libgdbmacros.a
rm: cannot remove `release/libgdbmacros.a': No such file or directory
mingw32-make[1]: [clean] Error 1 (ignored)
mingw32-make[1]: Leaving directory `C:/Qt/qt/qtc-debugging-helper'
rm libgdbmacros.a
rm: cannot remove `libgdbmacros.a': No such file or directory
mingw32-make: [clean] Error 1 (ignored)

Running C:/Qt/qt/bin/qmake.exe ...

Running C:/Qt/mingw/bin/mingw32-make.exe ...
C:/Qt/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Qt/qt/qtc-debugging-helper'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DUSE_QT_GUI=0 -DHAS_QOBJECT_P_H -DQT_DLL -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I'../include/QtCore' -I'../include' -I'../include/ActiveQt' -I'debug' -I'../mkspecs/win32-g++' -o debug/gdbmacros.o gdbmacros.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -shared -mthreads -Wl -Wl,--out-implib,debug/libgdbmacros.a -o debug/gdbmacros.dll debug/gdbmacros.o -L'c:/Qt/qt/lib' -lQtCored4
Creating library file: debug/libgdbmacros.a
mingw32-make[1]: Leaving directory `C:/Qt/qt/qtc-debugging-helper'

wysota
22nd November 2009, 13:02
What if you run your application without debugging? Does it run ok or does it crash?

cae
22nd November 2009, 13:10
It runs perfectly :eek:

I'm going crazy

Can anyone with windows compare my configuration with the one he has?