Debugger failed.

  • 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"
    So, any help would be appreciated.

  • Moderators

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

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

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

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

  • Qt Champions 2017

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

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

  • @aha_1980

    &"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/", line 35, in <module>\n"
    &" import struct\n"
    &" File "/usr/local/lib/python3.6/", line 13, in <module>\n"
    &" from _struct import *\n"
    &"ImportError: /usr/local/lib/python3.6/lib-dynload/ 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."
    dState changed from EngineSetupRequested(1) to EngineSetupFailed(2) [master]

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.