QtCreator's Debugger not working with CLI apps
-
wrote on 12 Sept 2023, 14:57 last edited by Pete Carter 9 Dec 2023, 14:59
I created a simple C++ CLI app (Non-Qt Project > Plain C++ Application) in QtCreator.
main.cpp
#include <iostream> int main() { std::cout << "Hello, world!\n\n"; return 0; }
hello_world.pro
TEMPLATE = app CONFIG += console c++17 CONFIG -= app_bundle CONFIG -= qt SOURCES += \ main.cpp
Now when running this app, the output is as expected:
That "qtc-process_stub" error is mentioned here and i think it has nothing to do with this topic.
Notice that i am using the external terminal, the app is running in the external terminal. Everything works fine.
Now when i try debugging the app, no output is shown in the terminal from the debugger:
Terminal window:
IDE's window:
Even when i try setting breakpoints, the debugger is showing no output ?!
The debuggers are configured correctly in the settings, both GDB and LLDB.
It's also worth mentioning that the debugger works fine in Qt projects.
-
I created a simple C++ CLI app (Non-Qt Project > Plain C++ Application) in QtCreator.
main.cpp
#include <iostream> int main() { std::cout << "Hello, world!\n\n"; return 0; }
hello_world.pro
TEMPLATE = app CONFIG += console c++17 CONFIG -= app_bundle CONFIG -= qt SOURCES += \ main.cpp
Now when running this app, the output is as expected:
That "qtc-process_stub" error is mentioned here and i think it has nothing to do with this topic.
Notice that i am using the external terminal, the app is running in the external terminal. Everything works fine.
Now when i try debugging the app, no output is shown in the terminal from the debugger:
Terminal window:
IDE's window:
Even when i try setting breakpoints, the debugger is showing no output ?!
The debuggers are configured correctly in the settings, both GDB and LLDB.
It's also worth mentioning that the debugger works fine in Qt projects.
wrote on 13 Sept 2023, 07:34 last edited by@Pete-Carter Would you mind opening a bugreport on bugreports.qt.io and describe your build environment a little more? What compilers, debugger, qt version, Qt Creator version etc.
Thanks!
-
@Pete-Carter Would you mind opening a bugreport on bugreports.qt.io and describe your build environment a little more? What compilers, debugger, qt version, Qt Creator version etc.
Thanks!
wrote on 13 Sept 2023, 08:03 last edited byCreated a bug here: https://bugreports.qt.io/browse/QTCREATORBUG-29608?filter=-2
-
wrote on 13 Sept 2023, 08:35 last edited by
I believe Qt Creator reroutes the output when debugging. Doesn't seem to make much sense when running a CLI application. At least on Windows there needs to be special treatment for GUI applications because they don't have a console output by default.
The output might show in the Global Debugger Log (menu View -> Views -> Global Debugger Log). However, it will be intermingled with a lot of other things. (I am not sure if it is the Global Debugger Log view or another view. But there is a special view somewhere.)
-
I believe Qt Creator reroutes the output when debugging. Doesn't seem to make much sense when running a CLI application. At least on Windows there needs to be special treatment for GUI applications because they don't have a console output by default.
The output might show in the Global Debugger Log (menu View -> Views -> Global Debugger Log). However, it will be intermingled with a lot of other things. (I am not sure if it is the Global Debugger Log view or another view. But there is a special view somewhere.)
wrote on 13 Sept 2023, 08:59 last edited byIssue fixed in QtCreator 11.0.3
Downloaded it from here: https://download.qt.io/snapshots/qtcreator/11.0/11.0.3/43/
-
Issue fixed in QtCreator 11.0.3
Downloaded it from here: https://download.qt.io/snapshots/qtcreator/11.0/11.0.3/43/
wrote on 13 Sept 2023, 09:02 last edited byThis post is deleted! -
A aha_1980 has marked this topic as solved on 24 Dec 2023, 05:12
1/6