rpdb2:如何连接到pid

Ale*_*aru 3 python winpdb pdb

我有一个wsgi应用程序在代码中有这个:

import rpdb2; rpdb2.start_embedded_debugger("asdf")
Run Code Online (Sandbox Code Playgroud)

现在使用rpdb2(而不是winpdb!)我想连接到进程并开始调试.

我无法弄清楚如何做到这一点.如何连接到正在运行的进程或如何使该进程连接到调试器?

Bar*_*ber 8

使用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
Run Code Online (Sandbox Code Playgroud)