2012-09-11 43 views
3

我有有这样的代码WSGI应用:rpdb2:如何连接到一个PID

import rpdb2; rpdb2.start_embedded_debugger("asdf") 

现在使用rpdb2(!不winpdb)我想连接到过程和启动调试。

我不知道该怎么做。如何连接到正在运行的进程,或者如何使该进程连接到调试器?

回答

7

内rpdb2使用命令:

(我假设你想连接来处理本地主机上运行,​​否则你应该使用--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