Python remote debugging with your ADDM development VM
PRE-REQUISITS › You need to have working ADDM dev environment. › You must have setup Eclipse IDE with proper project which should point to your ADDM dev VA code. › You need Python’s PYDEV module.
SETUP STEPS › Copy from your eclipse directory the following directory onto your dev appliance. ( /plugins/org.python.pydev.debug_x.x.x.x/pysrc). E.g : /usr/tideway/dev/pydevd/ › Include the directory into your PYTHONPATH on your appliance. For this we need to edit tw_setup. Please note you need to edit $TIDEWAY/tw_setup on your DEV VA. › In the pydevd edit the file pydevd_file_utils.py file so that “PATHS_FROM_ECLIPSE_TO_PYTHON” list have value : PATHS_FROM_ECLIPSE_TO_PYTHON = [(r'Z:\dev\code\trunk\python', r'/usr/tideway/dev/code/trunk/python'),(r'C:\Python27\lib',r'/usr/tideway/lib/python2. 7')]
SETUP STEPS CONTD.1 › Now modify your python code with following statements. › You can add the below code snippet at $TIDEWAY/python/common/daemonise.py (after log message : logger.debug( "Daemon setup complete" ) ) OR $TIDEWAY/python/ui/web insert the following code in Launch.py after config.setupDaemon() › import pydevd;pydevd.settrace(host=' ', stdoutToServer=False, stderrToServer=False, suspend=False, trace_only_current_thread=False)
ECLIPSE SETTINGS › In Eclipse go to Windows->Customize Perspective -> Commands Tab › In the commands section select “Pydev Debug” check box. › After that click on Debug perspective. Press on start debug server option on tool bar. › Once we start debug server it starts listening on respective IP.
REFERENCE › If you need any more help please visit confluence page : › bugging+with+your+development+VM bugging+with+your+development+VM