問題描述
我需要調試由 multiprocessing.Process()
生成的子進程.pdb
調試器似乎不知道分叉并且無法附加到已經運行的進程.
I need to debug a child process spawned by multiprocessing.Process()
. The pdb
degugger seems to be unaware of forking and unable to attach to already running processes.
是否有任何更智能的 python 調試器可以附加到子進程?
Are there any smarter python debuggers which can be attached to a subprocess?
推薦答案
Winpdb 差不多就是這個定義更智能的 Python 調試器.它明確支持下叉,不確定它是否能很好地與配合使用multiprocessing.Process()
但值得一試.
Winpdb is pretty much the definition of a smarter Python debugger. It explicitly supports going down a fork, not sure it works nicely with multiprocessing.Process()
but it's worth a try.
有關檢查是否支持您的用例的候選列表,請參閱 Python 調試器列表 在 wiki 中.
For a list of candidates to check for support of your use case, see the list of Python Debuggers in the wiki.
這篇關于如何將調試器附加到 python 子進程?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!