I've found that stopping a program in QtCreator at a breakpoint stops the program output. For example, the following program gives this output when it hits the breakpoint:
#include <QDebug>
#include <unistd.h>
int main(int argc, char *argv[])
{
for (int i = 0; i < 20; ++i) {
qDebug() << "Printing line " << i << "\n";
}
int a = 0; // <-breakpoint here
}
Output:
07:50:37: Debugging starts
2020-09-04 07:50:44.162658-0700 editor[3615:65377] Printing line 0
2020-09-04 07:50:44.162689-0700 editor[3615:65377] Printing line 1
2020-09-04 07:50:44.162695-0700 editor[3615:65377] Printing line 2
2020-09-04 07:50:44.162699-0700 editor[3615:65377] Printing line 3
2020-09-04 07:50:44.162702-0700 editor[3615:65377] Printing line 4
2020-09-04 07:50:44.162706-0700 editor[3615:65377] Printing line 5
2020-09-04 07:50:44.162709-0700 editor[3615:65377] Printing line 6
2020-09-04 07:50:44.162713-0700 editor[3615:65377] Printing line 7
2020-09-04 07:50:44.162716-0700 editor[3615:65377] Printing line 8
2020-09-04 07:50:44.162720-0700 editor[3615:65377] Printing line 9
2020-09-04 07:50:44.162724-0700 editor[3615:65377] Printing line 10
2020-09-04 07:50:44.162727-0700 editor[3615:65377] Printing line 11
2020-09-04 07:50:44.162731-0700 editor[3615:65377] Printing line 12
2020-09-04 07:50:44.162735-0700 editor[3615:65377] Printing line 13
2020-09-04 07:50:44.162751-0700 editor[3615:65377] Pri
It just stops mid string like this. I've tried redirecting output to the terminal, but that just exits right away, without outputting anything. If I add usleep(20000); above the print line, it will print out all (20) of the strings. If I add usleep(10000); it will get to number 16.
I'm using QtCreator 4.13.0, Qt 5.15.0. I'm using Clang that came with MacOS Catalina (x86 64bit in /usr/bin). I'm using LLDB that came with it (also in /usr/bin/lldb).
This is a fresh install of the OS, there is nothing else installed on the system except the programs that came with it. MacOS version is 10.15.5.