我有一個服務器應用程序,可以使用inetd爲客戶端召喚。但是,如果我嘗試附加到使用inetd啓動的服務器進程,則會得到以下響應:ptrace:Operation not permitted。爲什麼gdb無法附加到使用inetd召喚的服務器應用程序?
gdb --annotate=3 /my/app/here <processId>
Current directory is /usr/local/bin/
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Reading symbols from /usr/local/bin/flumed...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
Attaching to program: /my/app/here, process <processId>
ptrace: Operation not permitted.
/usr/local/bin/<processId>: No such file or directory.
(gdb)
你運行GDB的根源? – 2009-10-19 03:17:13
'ptrace:不允許操作.'正如Alex建議的那樣,將GDB作爲與服務相同的UID或以root身份運行。 – ephemient 2009-10-19 03:39:32
不,不是root,但ps顯示我自己擁有的pid。 – WilliamKF 2009-10-19 14:43:14