Qt Creator,ptrace:不允许操作。什么是永久解决方案? [英] Qt Creator, ptrace: Operation not permitted. What is the permanent solution?

查看:539
本文介绍了Qt Creator,ptrace:不允许操作。什么是永久解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调试Qt creator中的 C ++ 代码时,出现以下错误

While debugging C++ code in Qt creator I get the following error

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

这里找到一个临时解决方案:尝试在QtProject中调试时接收错误

Here a temporary solution is found: Receiving error while trying to debug in QtProject


  • 临时解决方案(重新启动后将无法生存):

  • temporary solution (won't survive a reboot):

echo 0 | sudo tee / proc / sys / kernel / yama / ptrace_scope

在终端中运行相同的代码每次当我启动我的电脑使用Qt。

But it is difficult to run the same code in terminal every time when I start my PC to use Qt.

What is the permanent solution for this?


推荐答案


  • 转到具有root权限的位置 / etc

查找文件 rc.local

重新启动您的电脑,工作完美。

Restart your pc and you can see the debugger working perfectly.

这篇关于Qt Creator,ptrace:不允许操作。什么是永久解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆