Home » Language IDEs » C / C++ IDE (CDT) » Eclipse debugging a Qt form with strange behaviour(C++ Qt 5.3 Mingw32)
Eclipse debugging a Qt form with strange behaviour [message #1431210] |
Thu, 25 September 2014 10:56 |
Sequoia Tree Messages: 28 Registered: August 2014 |
Junior Member |
|
|
I've finally got eclipse to compile a Qt form in a release build and a debug build
using makefiles. Versions SF003.exe and SF003d.exe put the Form up just fine.
Now when I debug it, it comes to a halt at the start of a main.c file deep in the Qt folder. When I press resume, then
it reaches the breakpoints I have set in my cpp code. Very strange. A cpp program demands the presence of a C-coded main.c file
where 'hello world' is outputted.
Can I tweak the g++ compile and link process to stop doing this?
this is how the debug exe (SF003d.exe) is built,
in five of the lines, #1, #3, #4 #5 & #6, the included directory E:/Qt/Tools/QtCreator/share/qtcreator/templates/wizards/plaincapp/common
is the location of this silly little main.c
mingw32-make.exe -f makefile.Debug all
#1
g++.exe -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -IE:/Qt/5.3/mingw482_32/include -IE:/Qt/Tools/QtCreator/share/qtcreator/templates/wizards/plaincapp/common -IE:/Qt/5.3/mingw482_32/include/QtWidgets -IE:/Qt/5.3/mingw482_32/include/QtGui -IE:/Qt/5.3/mingw482_32/include/QtCore -IE:/Qt/5.3/mingw482_32/mkspecs/win32-g++ -I"debug" -I"." -o ./debug/src/main.o -c "./src/SF003.cpp"
#2
uic.exe ./src/mainwindow.ui -o "./src/ui_mainwindow.h"
#3
g++.exe -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -IE:/Qt/5.3/mingw482_32/include [b]-IE:/Qt/Tools/QtCreator/share/qtcreator/templates/wizards/plaincapp/common[/b] -IE:/Qt/5.3/mingw482_32/include/QtWidgets -IE:/Qt/5.3/mingw482_32/include/QtGui -IE:/Qt/5.3/mingw482_32/include/QtCore -IE:/Qt/5.3/mingw482_32/mkspecs/win32-g++ -I"debug" -I"." -o "./debug/src/mainwindowd.o" -c "./src/mainwindow.cpp"
#4
moc.exe -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -D__GNUC__ -DWIN32 -IE:/Qt/5.3/mingw482_32/include [b]-IE:/Qt/Tools/QtCreator/share/qtcreator/templates/wizards/plaincapp/common[/b] -IE:/Qt/5.3/mingw482_32/include/QtWidgets -IE:/Qt/5.3/mingw482_32/include/QtGui -IE:/Qt/5.3/mingw482_32/include/QtCore -IE:/Qt/5.3/mingw482_32/mkspecs/win32-g++ -I"debug" -I"." ./src/mainwindow.h -o ./src/moc_mainwindow.cpp
#5
moc.exe -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -D__GNUC__ -DWIN32 -IE:/Qt/5.3/mingw482_32/include [b]-IE:/Qt/Tools/QtCreator/share/qtcreator/templates/wizards/plaincapp/common[/b] -IE:/Qt/5.3/mingw482_32/include/QtWidgets -IE:/Qt/5.3/mingw482_32/include/QtGui -IE:/Qt/5.3/mingw482_32/include/QtCore -IE:/Qt/5.3/mingw482_32/mkspecs/win32-g++ -I"debug" -I"." ./src/mainwindow.h -o ./src/moc_mainwindow.cpp
#6
g++.exe -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -IE:/Qt/5.3/mingw482_32/include [b]-IE:/Qt/Tools/QtCreator/share/qtcreator/templates/wizards/plaincapp/common[/b] -IE:/Qt/5.3/mingw482_32/include/QtWidgets -IE:/Qt/5.3/mingw482_32/include/QtGui -IE:/Qt/5.3/mingw482_32/include/QtCore -IE:/Qt/5.3/mingw482_32/mkspecs/win32-g++ -I"debug" -I"." -o "./debug/src/moc_mainwindowd.o" -c ./src/moc_mainwindow.cpp
#7
g++ -Wl,-subsystem,windows -mthreads -o debug/SF003d.exe ./debug/src/main.o debug/src/mainwindowd.o debug/src/moc_mainwindowd.o -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -LE:/Qt/5.3/mingw482_32/lib -lqtmaind -LC:/mingw482/mingw32/lib -LC:/Utils/icu32_52_1_mingw482/lib -LC:/utils/postgresql/pgsql/lib -LC:/utils/mysql/mysql/lib -LC:/opensll/lib -LE:/Qt/5.3/mingw482_32/lib -lQt5Widgetsd -lQt5Guid -lQt5Cored
[Updated on: Thu, 25 September 2014 11:02] Report message to a moderator
|
|
| | | |
Re: Eclipse debugging a Qt form with strange behaviour [message #1435245 is a reply to message #1434675] |
Wed, 01 October 2014 07:55 |
Sequoia Tree Messages: 28 Registered: August 2014 |
Junior Member |
|
|
Thanks for the reply. As you indicated I have prepared here something to trace :
Here is a really easy hello world program
Eclipse projects are all in E:\cpp directory
##########################
a2.cpp :
#include <iostream>
using namespace std;
int main(void) {
int j = 10;
j = j + 32; // a desired breakpoint
cout << "Hello Eclipsers, the answer is : " << j << endl;
return 0;
}
#####################################
built in a makefile which does this :
mingw32-make -f makefile.debug all
//target = objs debug
g++ -O2 -g -Wall -fmessage-length=0 -c -o a2d.o a2.cpp
//target = exe debug
g++ -o a2d.exe a2d.o
#########################################
#########################################
debug configuration details :
no arguments, no environment varis, default source and the
gdbinit.txt file is empty.
running this debug config results in an error :
---------------------------------------------------------------------
Failed to execute MI command:
-exec-run
Error message from debugger back end:
The target does not support running in non-stop mode
The target does not support running in non-stop mode .
---------------------------------------------------------------------
In the console frame I have :
--------------------------------------------------------------------
$1 = 0xff
The target endianness is set automatically (currently little endian)
-------------------------------------------------------------------
this is the gdb trace shown in one of the 5 consoles :
-------------------------------------------------------------------
330,315 2-environment-cd E:/cpp/a2
330,323 2^done
330,324 (gdb)
330,324 3-gdb-set breakpoint pending on
330,325 3^done
330,325 (gdb)
330,325 4-gdb-set detach-on-fork on
330,325 4^done
330,325 (gdb)
330,326 5-gdb-set python print-stack none
330,327 5^done
330,327 (gdb)
330,328 6-gdb-set print object on
330,337 6^done
330,337 (gdb)
330,338 7-gdb-set print sevenbit-strings on
330,343 7^done
330,343 (gdb)
330,344 8-gdb-set host-charset UTF-8
330,346 8^done
330,346 (gdb)
330,346 9-gdb-set target-charset WINDOWS-1252
330,349 9^done
330,349 (gdb)
330,350 10-gdb-set target-wide-charset UTF-16
330,350 10^done
330,350 (gdb)
330,350 11source E:\cpp\SF004\src\gdbinit.txt
330,351 &"source E:\\cpp\\SF004\\src\\gdbinit.txt\n"
330,351 11^done
330,351 (gdb)
330,352 12-gdb-set target-async on
330,352 12^done
330,352 (gdb)
330,353 13-gdb-set pagination off
330,353 13^done
330,353 (gdb)
330,354 14-gdb-set non-stop on
330,354 14^done
330,354 (gdb)
330,355 15-gdb-set auto-solib-add on
330,355 15^done
330,355 (gdb)
330,356 16-file-exec-and-symbols --thread-group i1 E:/cpp/a2/a2d.exe
330,360 16^done
330,360 (gdb)
330,360 17-gdb-show --thread-group i1 language
330,361 17^done,value="auto"
330,361 (gdb)
330,361 18-gdb-set --thread-group i1 language c
330,365 18^done
330,365 (gdb)
330,366 19-interpreter-exec --thread-group i1 console "p/x (char)-1"
330,372 ~"$1 = 0xff\n"
330,372 19^done
330,372 (gdb)
330,373 20-data-evaluate-expression --thread-group i1 "sizeof (void*)"
330,373 20^done,value="4"
330,373 (gdb)
330,374 21-gdb-set --thread-group i1 language auto
330,374 21^done
330,374 (gdb)
330,374 22-interpreter-exec --thread-group i1 console "show endian"
330,374 ~"The target endianness is set automatically (currently little endian)\n"
330,374 22^done
330,374 (gdb)
330,378 23-list-thread-groups
330,386 23^done,groups=[{id="i1",type="process",executable="E:/cpp/a2/a2d.exe"}]
330,386 (gdb)
330,386 24-break-insert -f E:\\cpp\\a2\\a2.cpp:15
330,389 24^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x004037b6",func="m\
ain()",file="a2.cpp",fullname="E:\\cpp\\a2\\a2.cpp",line="15",thread-groups=["i1"],times="0",origina\
l-location="E:\\\\cpp\\\\a2\\\\a2.cpp:15"}
330,389 (gdb)
330,396 25-exec-run --thread-group i1
330,399 25^error,msg="The target does not support running in non-stop mode."
330,399 (gdb)
330,401 26-gdb-exit
330,411 26^exit
-------------------------------------------------------
[Updated on: Wed, 01 October 2014 07:58] Report message to a moderator
|
|
| | |
Goto Forum:
Current Time: Fri Oct 04 01:53:28 GMT 2024
Powered by FUDForum. Page generated in 0.04268 seconds
|