Breakpoint set after run is not recognized in Qt Creator
-
wrote 28 days ago last edited by
Hi , everyone~
In Qt Creator 16.0.2, any breakpoint you set before starting the debugger is hit as expected. However, if you try to add a new breakpoint after the application is already running the IDE marks it but it never becomes “active” and won’t be hit (and can even cause the debugger to hang when setting it).
What I’ve TriedStart debugging with a breakpoint on MainWindow::~MainWindow() → hit OK.
Once running, click in the margin at QApplication a(argc, argv); to add a new breakpoint → turns red/grey but never activates.
Stop & restart with that breakpoint set before launching → it works perfectly.
This happens identically in:
Qt 5.15.0 project (GDB 11.2.0 + MinGW 8.1.0)
Qt 6.9.1 project (GDB 13.1.0 + MinGW 13.1.0)Image 1: Breakpoint on MainWindow::~MainWindow() (set before run) is recognized and hit.
Image 2: Breakpoint on QApplication a(argc, argv); (added after run) turns grey and never hits.
-
@cool19940620 Can you have a look in View > Views > Debugger Log? It might contain more insight to the problem.
Regards
-
wrote 28 days ago last edited by
d[GDB] TAKING OWNERSHIP OF BREAKPOINT 37
d[GDB] RUNNING NEEDS-STOP COMMAND -break-insert -f ""D:/Project/QT_Project/untitled/mainwindow.cpp":8"
<559-break-insert -f ""D:/Project/QT_Project/untitled/mainwindow.cpp":8"d[GDB] 559: -break-insert -f ""D:/Project/QT_Project/untitled/mainwindow.cpp":8"
d[GDB] 560: -break-insert -f ""D:/Project/QT_Project/untitled/mainwindow.cpp":13"
d[GDB] TIMED OUT WAITING FOR GDB REPLY. COMMANDS STILL IN PROGRESS: "-break-insert -f ""D:/Project/QT_Project/untitled/mainwindow.cpp":8"", "-break-insert -f ""D:/Project/QT_Project/untitled/mainwindow.cpp":13""I have recorded a video, which you can view at the following URL: https://youtu.be/acRtNZ6PJOs
-
@cool19940620 I think you should write a bugreport at bugreports.qt.io and attach this information.
Please provide a link to the report here so others can follow.
Regards
-
wrote 28 days ago last edited by
Sure—I've filed the issue. You can track the bug report here:
https://bugreports.qt.io/browse/QTCREATORBUG-33076Regards,
-
wrote 27 days ago last edited by
Thank you very much for all of your help — I’ve already resolved the issue~
I referred to the following post:
https://stackoverflow.com/questions/65263280/qt-android-unable-to-debug-error-unable-to-find-dynamic-linker-breakpoint-fun/65275623#65275623Here are the steps I took:
1.Installed CMake and Ninja using the MaintenanceTool.
2.Changed the CMake Tool setting to CMake, and the CMake Generator to Ninja.
3.Removed the line handle SIGTRAP nopass nostop noprint from Preferences → Debugger → GDB.
After deleting the build directory and rebuilding the project, everything is now working correctly.
-
1/6