假设我正在编写并使用用户alice编译程序.然后该程序由用户bob在同一台机器上运行,但是从alice无法访问的位置运行.
alice@localhost:/home/alice$ g++ helloworld.cpp -o helloworld -g
bob@localhost:/home/bob$ cp ../alice/helloworld .
bob@localhost:/home/bob$ ./helloworld
Run Code Online (Sandbox Code Playgroud)
现在,爱丽丝想要调试bob正在做什么.开箱即用,这是不可能的:
alice@localhost:/home/alice$ pidof helloworld
1234
alice@localhost:/home/alice$ gdb
[...]
(gdb) attach <pidof helloworld>
Attaching to process 1234
ptrace: Operation not permitted.
Run Code Online (Sandbox Code Playgroud)
爱丽丝应该怎么做?