由於某些原因,我無法附加到我自己的流程?!工作正常,如果我嘗試strace
作爲根。PTRACE_ATTACH不允許用於
$ ./list8 &
[1] 3141
$ child4 starts...
$ strace -p 3141
attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
$ cat /proc/sys/kernel/yama/ptrace_scope
1
上lubuntu 13.10
Linux goal 3.8.0-19-generiC#29-Ubuntu SMP Wed Apr 17 18:19:42 UTC 2013 i686 i686 i686 GNU/Linux
那麼接下來怎麼做gdb
連接到用戶自己的進程中運行,而不必淤泥與周圍的內核設置(ptrace_scope
)?
http://askubuntu.com/questions/41629/after-upgrade-gdb-wont-attach-to-process –