I could attach winpdb to openerp and debug remotely.
1. I've installed winpdb in my ubuntu client development workstation
2. I've installed winpdb in my ubuntu openerp server development environment (version 1.4.6)
3. in my ubuntu openerp server i've exported PYTHONPATH
Code:
export PYTHONPATH=/usr/lib/python2.5/site-packages/oldxml
this is to avoid xml import error that arises trying to execute " from xml import dom, xpath"
4. i've launched openerp server from command line using rpdb2
Code:
rpdb2 -r -d ./openerp-server-5.0.5.py --config=(path to config file)
5. The command asks for a debug password. This password is the one you need to attach winpdb from develepment workstation
6. in winpdb, i've clicked "attach" on file menu. Winpdb asked for a password, i've entered the password i've used in the previous step
7. i've entered the ip address of the server
8. I've selected the source file winpdb proposed to debug (openerp-server-5.0.5.py)
9. i've clicked run from the toolbar (or F5)
10. I've opened the source file i wanted to debug using "file/open source" menu item
11. I've entered the server file path of the file a wanted to debug
12. Winpdb showed the source file
13. i've set breakpoints in the code and make the code being executed using openerp client
Winpdb works Ok, but sometimes i've observed that local variables are not shown in winpdb. I've found a workaround: winpdb shows a rpdb2 command line on its user interface, when I want to observe a variable content I type "exec print the_variable_i_wanted_to_observe". The print statement is executed and shown in the server console.
Hope it helps!!!