使用reptyr
Ubuntu下,直接apt-get安裝即可
使用方法就是
reptyr <PID>
比如你需要獲取的程序PID爲7191,那麼需要執行的命令就是
reptyr 7191
如果出現這種情況
[-] Process 4118 (python) shares 7191's process group. Unable to attach.
(This most commonly means that 7191 has suprocesses).
Unable to attach to pid 7191: Invalid argument
如下圖
直接在命令後面添加參數 -T 然後使用管理員權限運行即可
sudo reptyr 7191 -T