Attaching a process with pdb

前端 未结 3 1944
醉酒成梦
醉酒成梦 2020-12-04 17:01

I have a python script that I suspect that there is a deadlock. I was trying to debug with pdb but if I go step by step it doesn\'t get the deadlock, and by the

3条回答
  •  伪装坚强ぢ
    2020-12-04 17:30

    There is a clone of pdb, imaginatively called pdb-clone, which can attach to a running process.

    You simply add from pdb_clone import pdbhandler; pdbhandler.register() to the code for the main process, and then you can start pdb with pdb-attach --kill --pid PID.

提交回复
热议问题