现象
刚更新2021.03新版的Clion,试了一下,可以build,可以run,但不能Debug,一Debug就报错。尝试在root下启动Clion,就可以Debug了。
错误信息:process exited with status -1 (attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.))
解决方案
看报错,应该就是权限问题。试了一大通方案,有说lldb没调试权限的,要去创建证书什么的,照做了,还是不行。
然后在Clion中瞎摸索,在运行/编辑配置中,有一个以root权限运行,把它勾选上就可以了。