Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 2.2.0
-
None
-
Windows 7 x64, Qt SDK 1.1.1
-
785b82177fe55d2773b7c30884979759c4ab9291
Description
I'm an educator and stepping through code line-by-line from line #1 is very important for the first class intro of the development environment. This problem got better in Qt Creator 2.1, compared to 2.0.1 and prior, but it's not still completely working. Prior to 2.1, the debugger session of any standard C++ hello world type console application on Windows Qt Creator didn't respond at all. From 2.1, it's now functioning (I guess qtcreator_process_stub.exe is now somehow fixed). However, when I set a breakpoint at the very first line of main() in such a console application, the debugger doesn't stop at the breakpoint. It does stop if I add "cin.get();" in the previous line of the breakpoint, so I guess it's related to some timing issue between gdb.exe and qtcreator_process_stub.exe. I tried this same scenario on a Linux installation and it doesn't occur there. Here's the source code I tried, even though it's so obvious:
#include <iostream> using namespace std; int main(int argc, char *argv[]) { cin.get(); // if commented out, the debugger doesn't stop at the breakpoint in the next line. cout << "Hello, world!" << endl; // breakpoint int sum = 0; for (int i = 1; i <= 10; i++) sum += i; cout << sum << endl; cout << "Enter a number: "; int n; cin >> n; cout << "You entered " << n << "!" << endl; return 0; }
Thanks.
Attachments
Issue Links
- relates to
-
QTCREATORBUG-6695 debugger takes too long to attach to started application
- Closed
-
QTCREATORBUG-6141 QtCreator starts application before debugger, when "Run in terminal" is set in Projects>Run options
- Closed