Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Is there any way to keep or reconnect debugger after restarting application ?



  • I tried to develop restarting application with this article "How to restart an application by pressing a button?".

    But after application restarted, the debugger stopped and I can't reconnect the debugger.
    I think I can't keep connecting debugger after "qApp->quit()".

    If there is any way to keep debugging after restarted application, please tell me.

    Thanks.



  • I found Attach to Running Application, and I could break C++ code on debugger.
    But I can't debug QML code because I can't know QML port for attaching.

    So, is there any way to know QML port for restarted application ?

    I tried following code
    Then app restarted, I tried "Attach to QML port" with QtCreator.
    But QtCreator couldn't connect to QML port "34567" for debugging.

    void Restarter::makeRestart( QString lib_namme )
    {
        process.setProgram(qApp->arguments()[0]);
        process.setNativeArguments({"-qmljsdebugger=port:34567"});
        qint64 pid;
        process.startDetached(&pid);
    }
    

    Thanks.


Log in to reply