<html><body>
<p><font size="2" face="sans-serif">We have found that Winpdb (<a href="http://winpdb.org/">http://winpdb.org/</a> - platform independent despite Win in the name) works well with multi-threaded Python.  While using PyDev for development, run Winpdb as a remote debugger for the multithreaded service.  Flow is like this:</font><br>
<br>
<font size="2" face="sans-serif">Launch Winpdb GUI</font><br>
<font size="2" face="sans-serif"># winpdb</font><br>
<br>
<font size="2" face="sans-serif">Start Debugging </font><br>
<font size="2" face="sans-serif"># cd /home/openstack-dev/workspace/nova/bin </font><br>
<font size="2" face="sans-serif"># winpdb -d -r <file_to_debug> </font><br>
<font size="2" face="sans-serif">Set Password: openstack </font><br>
<br>
<font size="2" face="sans-serif">Attach to Process</font><br>
<font size="2" face="sans-serif">1) In Winpdb GUI, select File -> Attach</font><br>
<font size="2" face="sans-serif">2) Enter password from step 4, should display files associated with that password </font><br>
<font size="2" face="sans-serif">3) Select process/file then select OK </font><br>
<font size="2" face="sans-serif">  </font><br>
<font size="2" face="sans-serif">To Stop Debug or Make Changes and Restart </font><br>
<font size="2" face="sans-serif">1) File -> Stop to detach current debugger </font><br>
<font size="2" face="sans-serif">2) Make changes in Eclipse and Save (make sure development user has write privileges to repository) </font><br>
<font size="2" face="sans-serif">3) kill and restart winpdb debugging process started above</font><br>
<font size="2" face="sans-serif">4) Re-attach to the process in the Winpdb GUI</font><br>
<font size="2" face="sans-serif"><br>
Michael<br>
<br>
-------------------------------------------------<br>
Michael Fork<br>
Cloud Architect, Emerging Solutions<br>
IBM Systems & Technology Group</font><br>
<br>
<tt><font size="2">michel.gauthier@bull.net wrote on 08/17/2012 07:59:18 AM:<br>
<br>
> From: michel.gauthier@bull.net</font></tt><br>
<tt><font size="2">> To: openstack-dev@lists.openstack.org, </font></tt><br>
<tt><font size="2">> Date: 08/17/2012 08:02 AM</font></tt><br>
<tt><font size="2">> Subject: [openstack-dev] Problem with debugging program having <br>
> eventlet.monkey_patch() code</font></tt><br>
<tt><font size="2">> <br>
> Hi all, <br>
> I want to debug nova-scheduler service (Essex version)  code with <br>
> Eclipse->Pydev->Debug Configuration. <br>
> But when I launch it under Debug Configuration, I get the following <br>
> error messages : <br>
> <br>
> pydev debugger: starting <br>
> Traceback (most recent call last): <br>
>   File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line<br>
> 336, in fire_timers <br>
>     timer() <br>
>   File "/usr/lib/python2.7/dist-packages/eventlet/hubs/timer.py", <br>
> line 56, in __call__ <br>
>     cb(*args, **kw) <br>
>   File "/usr/lib/python2.7/dist-packages/eventlet/semaphore.py", <br>
> line 95, in _do_acquire <br>
>     waiter.switch() <br>
> error: cannot switch to a different thread <br>
> <br>
> and then, Pydev debugger does not work! <br>
> <br>
> In fact, these errors are due to the use of eventlet.monkey_patch() inside <br>
> nova-scheduler launcher (as well as inside other nova-* launchers). <br>
> <br>
> Do you have any ideas to resolve this problem? <br>
> <br>
> Thanks in advance._______________________________________________<br>
> OpenStack-dev mailing list<br>
> OpenStack-dev@lists.openstack.org<br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</font></tt></body></html>