Important: Please read the Qt Code of Conduct -

[Solved] QProcess execute GDB cannot popup a terminal window for input/output.

  • We are now using Qt to build a simple IDE for single file compile & run(only terminal application). We got some trouble when we are writing the debugger module. We used QProcess to execute GDB (machine interface), and use readyReadStandardOutput signal to receive messages. We hope we could popup a terminal window like most other IDEs for input and output. But now there's no window popup.

    Let me show you an example:

    Here's a simple C program, let's say it's a.c:

    #include <stdio.h>
    int main()
    printf(“Hello World!\n”);
    return 0;

    Compile the a.c, and we get a.exe. Then we use QProcess to execute GDB to debug it. Normally, it should show a terminal window(CMD) with "Hello world!" on it. But now there's nothing happend.

    Here's what we do:

    QStringList _arg;
    <<QString("--tty=" + getServerName());



    The "Hello World!" was received by readGdbStandardOutput slot. We take a look at the Qt Creator source code. I find out Qt Creator was using tty to redirect IO to a QMLJS terminal which was written by itself. But we find another IDE: Manna, which was known as GUIDE(Gait Universal IDE) in China, they finished this function with nothing special. Here's the source code of debugging module in Manna:

    So, how can I do to popup a terminal? Is it the problem of args? How Manna does this? I have been confused by this problem for a long time. Now, I've to ask for coummunity for help. Please help me to solve this problem. Thanks a lot!

  • Well, I've solved this.
    In Windows, write 'set new-console on'.
    In UNIX/Linux, use TTY instead. That's all write.

Log in to reply