使用gdb来debug C++程序时,会提示没有权限的,报错如下:
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/gdb' as the super user
Authenticating as: rainboat,,, (rainboat)
Password: [1] + Stopped (tty output) /usr/bin/pkexec "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-20hsq1h3.pie" 1>"/tmp/Microsoft-MIEngine-Out-vhfdpigx.4ir"
You have stopped jobs.
(base)
该问题可以通过运行如下命令解决:
sudo echo 0| sudo tee /proc/sys/kernel/yama/ptrace_scope