Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rpdb2: how to connect to a pid

Tags:

python

pdb

winpdb

I have a wsgi app which has this in the code:

import rpdb2; rpdb2.start_embedded_debugger("asdf")

Now using rpdb2 (not winpdb!) I would like to connect to the process and start debugging.

I can't figure out how to do that. How do I connect to a running process or how do I make that process to connect to the debugger?

like image 866
Alex Plugaru Avatar asked Oct 18 '25 10:10

Alex Plugaru


1 Answers

Use commands inside rpdb2:

(I assume that you want to connect to process running on localhost. Otherwise you should use --host switch)

 $ ./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
like image 79
Bartek Chaber Avatar answered Oct 19 '25 23:10

Bartek Chaber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!