Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Debugger failed.

Debugger failed.

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 4 Posters 4.3k Views
  • 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.
  • J Offline
    J Offline
    JasonCai
    wrote on 28 Nov 2017, 11:37 last edited by
    #1

    Hi !
    I'm using CentOS 7 , QtCreator 4.4.1 , QT5.9.2 , GCC 7.2.0 , GDB 8.0.1(with python) , Python 3.6.0
    When I choose to debug or attach to a running program ( e.g. , pid = 2595 ), it just prints "debugger starts. debugger has failed". However if I use gdb in terminal , it can successfully attach to the program which I am working on by "gdb -p 2595"
    0_1511868972997_QTerror1.png
    0_1511868979361_QTerror2.png
    So, any help would be appreciated.

    J 1 Reply Last reply 28 Nov 2017, 14:17
    0
    • J JasonCai
      28 Nov 2017, 11:37

      Hi !
      I'm using CentOS 7 , QtCreator 4.4.1 , QT5.9.2 , GCC 7.2.0 , GDB 8.0.1(with python) , Python 3.6.0
      When I choose to debug or attach to a running program ( e.g. , pid = 2595 ), it just prints "debugger starts. debugger has failed". However if I use gdb in terminal , it can successfully attach to the program which I am working on by "gdb -p 2595"
      0_1511868972997_QTerror1.png
      0_1511868979361_QTerror2.png
      So, any help would be appreciated.

      J Online
      J Online
      jsulm
      Lifetime Qt Champion
      wrote on 28 Nov 2017, 14:17 last edited by
      #2

      @JasonCai Did you configure the correct debugger in your Kit?

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

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JasonCai
        wrote on 28 Nov 2017, 15:22 last edited by
        #3

        Yes, first I didn't configure "--with-python" when I upgraded GDB, so I got "The selected build of GDB does not support Python scripting.". And after I set GDB correctly, it just throw out "Debugging has failed" without any more information.

        J 1 Reply Last reply 28 Nov 2017, 18:38
        0
        • J JasonCai
          28 Nov 2017, 15:22

          Yes, first I didn't configure "--with-python" when I upgraded GDB, so I got "The selected build of GDB does not support Python scripting.". And after I set GDB correctly, it just throw out "Debugging has failed" without any more information.

          J Online
          J Online
          JonB
          wrote on 28 Nov 2017, 18:38 last edited by JonB
          #4

          @JasonCai
          Where you have the breakpoint on the source, if you hover does it give information about why it can't be set?

          When I choose to debug or attach to a running program

          Do you mean it only fails attach/debug to a running program, or do you mean you have tried running a program in the debugger without the attaching and it still doesn't work?

          J 1 Reply Last reply 29 Nov 2017, 01:21
          0
          • J JonB
            28 Nov 2017, 18:38

            @JasonCai
            Where you have the breakpoint on the source, if you hover does it give information about why it can't be set?

            When I choose to debug or attach to a running program

            Do you mean it only fails attach/debug to a running program, or do you mean you have tried running a program in the debugger without the attaching and it still doesn't work?

            J Offline
            J Offline
            JasonCai
            wrote on 29 Nov 2017, 01:21 last edited by
            #5

            @JNBarchan Still doesn't work. I can run a program successfully and use GDB to attach to it in the terminal by "GDB -p 2595", but if I run the program in the debugger ( breakpoint can be seen in the second picture ) or attach to it by QtCreator (by this buttom0_1511917829325_47d6724f-2b46-4e3e-8b2e-462cc4b34623-image.png ) , it fails. After that , 0_1511918402387_4221db96-4679-44bc-b134-18d063c8fef8-image.png
            Thanks for your help.

            A 1 Reply Last reply 29 Nov 2017, 06:19
            0
            • J JasonCai
              29 Nov 2017, 01:21

              @JNBarchan Still doesn't work. I can run a program successfully and use GDB to attach to it in the terminal by "GDB -p 2595", but if I run the program in the debugger ( breakpoint can be seen in the second picture ) or attach to it by QtCreator (by this buttom0_1511917829325_47d6724f-2b46-4e3e-8b2e-462cc4b34623-image.png ) , it fails. After that , 0_1511918402387_4221db96-4679-44bc-b134-18d063c8fef8-image.png
              Thanks for your help.

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 29 Nov 2017, 06:19 last edited by aha_1980
              #6

              @JasonCai the debugger log (somewhere in the Window menu) might give some more insight.

              Edit: It's menu Window -> Views -> Debugger Log

              Qt has to stay free or it will die.

              J 1 Reply Last reply 29 Nov 2017, 09:46
              0
              • A aha_1980
                29 Nov 2017, 06:19

                @JasonCai the debugger log (somewhere in the Window menu) might give some more insight.

                Edit: It's menu Window -> Views -> Debugger Log

                J Offline
                J Offline
                JasonCai
                wrote on 29 Nov 2017, 09:46 last edited by
                #7

                @aha_1980
                Yes!

                &"python from gdbbridge import *\n"
                &"Traceback (most recent call last):\n"
                &" File "<string>", line 1, in <module>\n"
                &" File "/home/jason/Qt/Tools/QtCreator/share/qtcreator/debugger/gdbbridge.py", line 35, in <module>\n"
                &" import struct\n"
                &" File "/usr/local/lib/python3.6/struct.py", line 13, in <module>\n"
                &" from _struct import *\n"
                &"ImportError: /usr/local/lib/python3.6/lib-dynload/_struct.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyByteArray_Type\n"
                &"Error while executing Python code.\n"
                12^error,msg="Error while executing Python code."

                &"python theDumper.loadDumpers({"token":13})\n"
                &"Traceback (most recent call last):\n"
                &" File "<string>", line 1, in <module>\n"
                &"NameError: name 'theDumper' is not defined\n"
                &"Error while executing Python code.\n"
                13^error,msg="Error while executing Python code."
                dNOTE: ENGINE SETUP FAILED
                dState changed from EngineSetupRequested(1) to EngineSetupFailed(2) [master]
                dHANDLE RUNCONTROL START FAILED

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  JasonCai
                  wrote on 29 Nov 2017, 15:14 last edited by
                  #8

                  Thanks everyone!
                  I solved this problem by rebuild python with "--enable-shared"
                  Here are some references:
                  https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/
                  https://stackoverflow.com/questions/43333207/python-error-while-loading-shared-libraries-libpython3-4m-so-1-0-cannot-open

                  1 Reply Last reply
                  2

                  5/8

                  29 Nov 2017, 01:21

                  • Login

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