Cannot step into QT sources in my application only
-
Hi Folks
I have a problem with debugging QT sources in my application specifically. I installed precompiled QT 6.2.3 version for Linux. When I create a QT project in QtCreator or compile one of the QT’s examples I can debug them, everything is fine. But my application is using QT but it is not based on qmake system – it is plain makefile based one. When I compare build instructions in both cases I don’t see what might cause that I see only assembly instructions (although I see source file names and corresponding line numbers).
Here are the command lines for compilation of one of the files in my application and for link step:
*<tools>/tools/bin/c++ -MT .build/rhel8/obj/moc_tcl_notifier.o -MD -MP -MF .build/rhel8/deps/moc_tcl_notifier.Td -std=gnu++17 -pthread -Wshadow -Wno-class-memaccess -mcx16 -msse3 -mssse3 -mpopcnt -mcx16 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -O0
g++ -Wextra -D_REENTRANT -DQT_QML_DEBUG <some_dir>/make/../build/bin/rhel8/EC <tools>/tools/bin/c++ -L/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib -L<tools>/tools/lib -o <some_dir>/make/../build/bin/rhel8/EC .build/rhel8/obj/command_input.o .build/rhel8/obj/main.o .build/rhel8/obj/options.o .build/rhel8/obj/tcl_notifier.o .build/rhel8/obj/moc_tcl_notifier.o ../sys/.build/rhel8/obj/sys.a ../libedit/.build/rhel8/obj/libedit.a -g -ltcl8.6 -ltinfo -lpthread -lrt -Wl,-rpath=<tools>/tools/lib -Wl,-rpath=/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib /ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib/libQt6Widgets.so /ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib/libQt6Gui.so /ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib/libQt6Core.so*
<tools>/tools/bin/c++ and g++ are the same executable (gcc 11.2.0).
Here are the command lines for a sample application generated by QtCreator:
*g++ -c -pipe -g -Wall -Wextra -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../diagramscene -I. -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/include -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/include/QtWidgets -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/include/QtGui -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/include/QtCore -I. -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/mkspecs/linux-g++ -o moc_diagramtextitem.o moc_diagramtextitem.cpp
g++ -Wl,-rpath,/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib -Wl,-rpath-link,/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib -o diagramscene mainwindow.o diagramitem.o main.o arrow.o diagramtextitem.o diagramscene.o qrc_diagramscene.o moc_mainwindow.o moc_diagramscene.o moc_diagramtextitem.o /ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib/libQt6Widgets.so /ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib/libQt6Gui.so /ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/lib/libQt6Core.so -lpthread -lGL*
Any idea where to look?
Regards
Yeghia -
@yeghia
I see theg++
compilation line hasg++ -c -pipe -g
. The-g
means compile with debug. (You say this debugs well.)On your own file's compilation line,
<tools>/tools/bin/c++ -MT ...
, what option is compiling for debug? (You say this does not show source lines in debug.) -
I guess I dropped part of the line, sorry about that. Here is the one in full, as you can see there is -g option present right after -O0.
<tools>/tools/bin/c++ -MT .build/rhel8/obj/tcl_notifier.o -MD -MP -MF .build/rhel8/deps/tcl_notifier.Td -std=gnu++17 -pipe -pthread -Wall -Wshadow -Wno-class-memaccess -mcx16 -msse3 -mssse3 -mpopcnt -mcx16 -DQT_QML_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/include -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/include/QtCore -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/include/QtWidgets -I/ct/users/yeghia/QT6.2.3/6.2.3/gcc_64/include/QtGui -fPIC -O0 -g -I.build/rhel8/obj -I../../ -I<tools>/tools/include -I<tools>/tools/include/boost -c -o .build/rhel8/obj/tcl_notifier.o tcl_notifier.cpp