Debugger failed.
-
wrote on 28 Nov 2017, 11:37 last edited by
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. -
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 Did you configure the correct debugger in your Kit?
-
wrote on 28 Nov 2017, 15:22 last edited by
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.
-
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.
wrote on 28 Nov 2017, 18:38 last edited by 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?
-
@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?
wrote on 29 Nov 2017, 01:21 last edited by@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. -
@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.@JasonCai the debugger log (somewhere in the Window menu) might give some more insight.
Edit: It's menu Window -> Views -> Debugger Log
-
@JasonCai the debugger log (somewhere in the Window menu) might give some more insight.
Edit: It's menu Window -> Views -> Debugger Log
wrote on 29 Nov 2017, 09:46 last edited by@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 -
wrote on 29 Nov 2017, 15:14 last edited by
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
5/8