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. -
@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 buttom
) , it fails. After that ,
Thanks for your help. -
@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 -
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