Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems to debug a console application that create threads
Qt 6.11 is out! See what's new in the release blog

Problems to debug a console application that create threads

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 694 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    Hi, my application works correctly. When I try to debug it on Linux using lldb my application does not complete the start procedure.
    It stops at the point "'02", before the thread start command.
    Which is the way to resolve?

    int main(int argc, char *argv[])
    {
        QCoreApplication a(argc, argv);
        qDebug() << "begin";
    
        Class01 class01;
        QTimer::singleShot(1000, &class01, SLOT(onTimeout()));
    
        return a.exec();
    }
    
    
    Class01::Class01() {
        qDebug() << "00";
        QThread01 *th01= new QThread01();
        qDebug() << "01";
        QThread01 *th02= new QThread01();
        qDebug() << "02";
        th01->start();
        qDebug() << "03";
        th02->start();
        qDebug() << "04";
    }
    

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    jsulmJ 1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #11

      Solved using gdb by command line instead of lldb by qtcreator

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      1 Reply Last reply
      0
      • jeremy_kJ Offline
        jeremy_kJ Offline
        jeremy_k
        wrote on last edited by
        #2

        What is QThread01?

        Asking a question about code? http://eel.is/iso-c++/testcase/

        1 Reply Last reply
        0
        • mrdebugM Offline
          mrdebugM Offline
          mrdebug
          wrote on last edited by
          #3

          It is a Qt thread. It's run method is empty.

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

          1 Reply Last reply
          0
          • mrdebugM mrdebug

            Hi, my application works correctly. When I try to debug it on Linux using lldb my application does not complete the start procedure.
            It stops at the point "'02", before the thread start command.
            Which is the way to resolve?

            int main(int argc, char *argv[])
            {
                QCoreApplication a(argc, argv);
                qDebug() << "begin";
            
                Class01 class01;
                QTimer::singleShot(1000, &class01, SLOT(onTimeout()));
            
                return a.exec();
            }
            
            
            Class01::Class01() {
                qDebug() << "00";
                QThread01 *th01= new QThread01();
                qDebug() << "01";
                QThread01 *th02= new QThread01();
                qDebug() << "02";
                th01->start();
                qDebug() << "03";
                th02->start();
                qDebug() << "04";
            }
            
            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @mrdebug Did you try with gdb instead of lldb?
            Also, how does the stack trace look like when the app hangs?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • mrdebugM Offline
              mrdebugM Offline
              mrdebug
              wrote on last edited by
              #5

              I can't use gdb because I obtain the error

              "The selected build of GDB does not support Python scripting.
              It cannot be used in Qt Creator."

              The app does not hang. It is only a test app to study the issue.

              Here the sources
              http://www.denisgottardello.it/Test01.zip

              Need programmers to hire?
              www.labcsp.com
              www.denisgottardello.it
              GMT+1
              Skype: mrdebug

              jsulmJ 1 Reply Last reply
              0
              • mrdebugM mrdebug

                I can't use gdb because I obtain the error

                "The selected build of GDB does not support Python scripting.
                It cannot be used in Qt Creator."

                The app does not hang. It is only a test app to study the issue.

                Here the sources
                http://www.denisgottardello.it/Test01.zip

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @mrdebug said in Problems to debug a console application that create threads:

                The app does not hang

                The I don't understand what this means: "It stops at the point "'02", before the thread start command"

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • mrdebugM Offline
                  mrdebugM Offline
                  mrdebug
                  wrote on last edited by
                  #7

                  @mrdebug said in Problems to debug a console application that create threads:

                  When I try to debug it on Linux using lldb ....

                  Need programmers to hire?
                  www.labcsp.com
                  www.denisgottardello.it
                  GMT+1
                  Skype: mrdebug

                  JonBJ 1 Reply Last reply
                  0
                  • mrdebugM mrdebug

                    @mrdebug said in Problems to debug a console application that create threads:

                    When I try to debug it on Linux using lldb ....

                    JonBJ Online
                    JonBJ Online
                    JonB
                    wrote on last edited by
                    #8

                    @mrdebug
                    We have no idea what "It stops at the point "'02" might mean in lldb....

                    1 Reply Last reply
                    0
                    • mrdebugM Offline
                      mrdebugM Offline
                      mrdebug
                      wrote on last edited by
                      #9

                      Do you want to help me? Please download the source above and run it in debug mode using lldb and send me a feedback, specifying your os.

                      Need programmers to hire?
                      www.labcsp.com
                      www.denisgottardello.it
                      GMT+1
                      Skype: mrdebug

                      jsulmJ 1 Reply Last reply
                      0
                      • mrdebugM mrdebug

                        Do you want to help me? Please download the source above and run it in debug mode using lldb and send me a feedback, specifying your os.

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #10

                        @mrdebug I don't have time to set up lldb.
                        I asked this before: how does the stack trace look like when debugger stops?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1
                        • mrdebugM Offline
                          mrdebugM Offline
                          mrdebug
                          wrote on last edited by
                          #11

                          Solved using gdb by command line instead of lldb by qtcreator

                          Need programmers to hire?
                          www.labcsp.com
                          www.denisgottardello.it
                          GMT+1
                          Skype: mrdebug

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved