2014-03-30 37 views
1

每次我想要开始调试时,Qt创建者都会报错。以下是错误:无法在ubuntu中使用gdb进行调试

ptrace: Operation not permitted. 

Could not attach to the process. Make sure no other debugger traces this process. 
Check the settings of 
/proc/sys/kernel/yama/ptrace_scope 
For more details, see /etc/sysctl.d/10-ptrace.conf 

我用Google搜索了错误信息,并得到了有关在系统内核的BUG了一些成绩,但我可以在命令行中运行gdb,所以我不认为这是核心/ GDB相关。

这个错误的原因是什么?

+0

这是什么平台? – TheDarkKnight

+0

@ Merlin069嗯,这是Ubuntu 12.04和QT创作者版本3.0.1。内核版本是3.11 – khajvah

回答

0

我只是做了一些研究,发现解决方案的地方。事实证明/proc/sys/kernel/yama/ptrace_scope已被设置为1.在将其更改为0后,问题消失。

根据Merlin069的说法,ptrace的解释可以参见herehere

+0

ptrace_scope在这里解释:http://askubuntu.com/questions/41629/after-upgrade-gdb-wont-attach-to-process和在这里:http://askubuntu.com/questions/146160/什么是ptrace-scope-workaround-for-wine-programs-are-there-any-risks – TheDarkKnight

+0

@ Merlin069谢谢我更新了答案。 – khajvah

+0

没问题。我建议你将这个问题标记为回答,如果你对此感到满意的话; O) – TheDarkKnight