Remote Debugging for Eclipse+PyDev

When server is Linux, client is Windows, using Python.

In the python file:

add the following code

1
2
import pydevd
pydevd.settrace('202.120.38.30', port=5678)

in which the IP address is the Windows IP and the port is the default Eclipse debugger port.

Under Linux:

  1. pip install pydevd
  2. In the file lib/python2.7/site-packages/pydevd_file_utils.py, modify PATHS_FROM_ECLIPSE_TO_PYTHON = [(r'L:\test', r'/home/niuli/test')], in which the former is Windows path and the latter is Linux path.

Under Windows:

  1. Install Eclipse IDE and PyDev plugin for Eclipse.
  2. Pydev->Start Debug Server
  3. Open the Debug perspective and watch Debug Server.

After the above preparation, run python code under Linux and the debugging process will jump to the debug server under Windows. For interactive debugging, open PyDev Debug Console.