Reputation: 894
I'm trying for 3-4 days to set up my debugger in Qt without success.
I have Qt creator 2.7.0 with compiler MINGW and debugger gdb.exe on Windows 7
I'm building on debug mode, the debugger is skipping the breakpoints.
Thank you in advance for any tip
![qt setup][1]
This is how debugger output looks like:
sSetting breakpoints...
dSetting breakpoints...
dATTEMPT BREAKPOINT SYNCHRONIZATION
dTAKING OWNERSHIP OF BREAKPOINT 1 IN STATE 0
<53-break-insert -f "\"onmainwindow.cpp\":333"
dBREAKPOINTS ARE NOT FULLY SYNCHRONIZED
dATTEMPT SYNC
dATTEMPT BREAKPOINT SYNCHRONIZATION
dBREAKPOINTS ARE NOT FULLY SYNCHRONIZED
>&"No source file named onmainwindow.cpp in loaded symbols.\n"
>53^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="\"onmainwindow.cpp\":333",times="0"}
<54-break-delete 1
>54^done
<55-break-insert -f "\"onmainwindow.cpp\":333"
>&"No source file named onmainwindow.cpp in loaded symbols.\n"
>55^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="\"onmainwindow.cpp\":333",times="0"}
dATTEMPT BREAKPOINT SYNCHRONIZATION
dBREAKPOINTS ARE SYNCHRONIZED
dALL COMMANDS DONE; INVOKING CALLBACK
<56maint print msymbols C:/Users/Lucian/AppData/Local/Temp/gdb_ns_.Ae4844
>&"maint print msymbols C:/Users/Lucian/AppData/Local/Temp/gdb_ns_.Ae4844\n"
>56^done
dFOUND NON-NAMESPACED Qt
dNOTE: INFERIOR SETUP OK
dState changed from InferiorSetupRequested(4) to InferiorSetupOk(6) [master]
dState changed from InferiorSetupOk(6) to EngineRunRequested(7) [master]
dQUEUE: RUN ENGINE
dCALL: RUN ENGINE
<57-exec-run
>57^running
dNOTE: ENGINE RUN AND INFERIOR RUN OK
sRunning.
dState changed from EngineRunRequested(7) to InferiorRunOk(11) [master]
dINFERIOR STARTED
sApplication started
>~"[New thread 7144.0x1fdc]\n"
dFOUND PID 7144
dTaking notice of pid 7144
s[New thread 7144.0x1fdc]
>~"(no debugging symbols found)\n"
>~"(no debugging symbols found)\n"
>~"(no debugging symbols found)\n"
I installed also the new gdb debugger and it also doens;t stop ar breakpoints, this new gdb version outputs:
dATTEMPT SYNC
dATTEMPT BREAKPOINT SYNCHRONIZATION
dBREAKPOINTS ARE NOT FULLY SYNCHRONIZED
>&"No symbol table is loaded. Use the \"file\" command.\n"
>200^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="`<PENDING>",pending="\"onmainwindow.cpp\":55",times="0",original-location="\"onmainwindow.cpp\":55"}`
An interesting thing that I noticed is:
Although the debug build have the following configuration:
qmake.exe D:\Elance\X2GoClient\sources_v2.0\x2goclient.pro -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=declarative_debug"
and after that it runs step 2: make:C:\mingw\bin\mingw32-make.exe
where the CINFIG+=debug is mentioned for the debug
the debug output window shows me this:
20:11:11: Configuration unchanged, skipping qmake step.
20:11:11: Starting: "C:\mingw\bin\mingw32-make.exe"
C:/mingw/bin/mingw32-make -f Makefile.Release
is shows: make -f Makefile.Release..this is very strange is it ok to show that is building with the makefile from Release? Thanks
Upvotes: 2
Views: 2413
Reputation: 894
Ok, this might be useful for somebody: I had the above described problem and solve it with this changes:
Step 1(This problem I think is related to Qt Creator, I think it is build with configure -release instead of configure -debug-and-release flags)
I altered the x2goClient.pro like:
**BEFORE:**
win32-* {
message(building $$TARGET for windows without ldap and cups)
LIBS += -lwinspool -lws2_32
CONFIG += static release
}
**AFTER:**
win32-* {
message(building $$TARGET for windows without ldap and cups)
LIBS += -lwinspool -lws2_32
CONFIG += static debug
}
Step 2(I think due to the fact that Qt might be compiled wrong, the default make.exe step was interpreted as make -f Makefile.release although I selected the Debug build)
In projects->Build Steps->Make arguments
I placed: -f Makefile.Debug
Step 3: After doing these changes, I got several error related to some DLLs. The interesting fact was that Makefile.Debug that was generated by Qt was not generated ok, it contained some dll's like QtCored.dll that wasn't present on Qt, I have changed it as I found the dll's like from QtCored.dll to QtCored4.dll
Step 4: It seemed that the builder and debugger that I had wasn't right. I downloaded the latest MingW and change BOTH builder and debugger. First time I changed only the debugger and got "During startup program exited with code 0xc0000005" Error. When I changed BOTH builder and debugger of the latest MingW it finally worked. I am working with Qt for 2 weeks now, but I didn't have some much problems with an IDE so far in my life. Qt is good, but it's a bit hardcore to configure.
Upvotes: 0