Important: Please read the Qt Code of Conduct -

Can't attach debugger in QtCreator on Ubuntu

  • Hi,

    I'm trying to attach debugger to running application.
    If I do that from QtCreator I get the error:

    The GDB process terminated unexpectedly (exit code 1).

    and right after closing that window I also get another error:

    GDB IO error
    An error occured when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.
    Error writing to process

    But if I attach GDB directly from terminal then there is no any problem (as I think as its my first time I run GDB from terminal)

    By the way I follow instructions from here

    If I simply try to click on "RUN AND DEBUG" button then I also get the first error (even though the PATH var is complicated but it should be correct)

    The application is built by me in Debug config using CMake.
    Ubuntu 20.04

    My kit:


  • Hello,

    Your kit looks good. But a little more information may be required to determine the root cause of this issue.

    I assume you are building the Debug version of the application. In QtCreator this is accomplished through the left-side toolbar. You should be able to make Debug, MinRelease, Release, RelDebug versions.

    It appears you are using Qt 5.15.2 from the kit configuration.

    It is good you made the change to the ptrace_scope file as that step is required to debug on Ubuntu distros.

    Good Day,
    Michael Uman

  • @muman thank you for reply,

    Yes I'm building Debug version of an app.

    I don't know how but after I successively launched debugger in VS Code I'm now able to debug my application within QtCreator.

    Maybe restarting the PC also had some importance...

Log in to reply