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.
Qt 6.11 is out! See what's new in the release blog

Debugger failed.

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 4 Posters 6.5k Views 1 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.
  • J Offline
    J Offline
    JasonCai
    wrote on 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.

    jsulmJ 1 Reply Last reply
    0
    • J JasonCai

      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.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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 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.

        JonBJ 1 Reply Last reply
        0
        • J JasonCai

          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.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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
          0
          • JonBJ JonB

            @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 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.

            aha_1980A 1 Reply Last reply
            0
            • J JasonCai

              @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.

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 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
              0
              • aha_1980A aha_1980

                @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 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 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

                  • Login

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