Qt Creator, ptrace: Operation not permitted. What is the permanent solution?

后端 未结 3 1939
春和景丽
春和景丽 2020-12-22 23:55

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         


        
3条回答
  •  萌比男神i
    2020-12-23 00:11

    If running Ubuntu,

    The recommended way to enable the needed ptrace kernel setting (hinted by qtcreator) is to edit /etc/sysctl.d/10-ptrace.conf

    sudo vim  /etc/sysctl.d/10-ptrace.conf
    

    Then change

    kernel.yama.ptrace_scope = 1
    

    to

    kernel.yama.ptrace_scope = 0
    

    Save,

    then apply:

    $ sudo sysctl --system -a -p|grep yama
    kernel.yama.ptrace_scope = 0
    

    run

    man sysctl
    

    for more info.

提交回复
热议问题