我有一个 wsgi 应用程序,它在代码中有这个:
import rpdb2; rpdb2.start_embedded_debugger("asdf")
现在使用 rpdb2(不是 winpdb!)我想连接到进程并开始调试。
我不知道该怎么做。如何连接到正在运行的进程或如何使该进程连接到调试器?
在 rpdb2 中使用命令:
(我假设你想连接到在 localhost 上运行的进程。否则你应该使用 --host 开关)
$ ./rdb2
RPDB2 - The Remote Python Debugger, version RPDB_2_4_8,
Copyright (C) 2005-2009 Nir Aides.
Type "help", "copyright", "license", "credits" for more information.
> password "debugger"
Password is set to: "debugger"
> attach
Connecting to 'localhost'...
Scripts to debug on 'localhost':
pid name
--------------------------
7772 myscript.py
> attach 7772
> *** Attaching to debuggee...
> *** Debug Channel is encrypted.
> *** Successfully attached to
> *** 'myscript.py'.
> *** Debuggee is waiting at break point for further commands.
> go