Skip to content

Remote custom script debug

Yuriy Movchan edited this page Apr 10, 2018 · 1 revision

I. Prepare Eclipse.

  1. Install PyDev Eclispe plugin from Eclipse Markeplace.
  2. Open Debug perspective.
  3. Start the remote debugger server. Menu: PyDev->Start Debug Server.

II. Prepare CE

  1. Log into CE.
  2. cd /opt
  3. Download pydevd-1.1.1.tar.gz or more recent. Link: https://pypi.python.org/packages/39/66/ef4821f24953ef4e9be73de99209fa74d14b4fa90559571553c7c7ecaf61/pydevd-1.1.1.tar.gz
  4. tar -xzf pydevd-1.1.1.tar.gz
  5. rm -rf pydevd-1.1.1.tar.gz
  6. ln -sf /opt/pydevd-1.1.1 /opt/pydevd

III. Enable remote debug in custom script.

  1. Add ater import section:
REMOTE_DEBUG = True

if REMOTE_DEBUG:
    try:
        import sys
        sys.path.append('/opt/pydevd')
        import pydevd
    except ImportError as ex:
        print "Failed to import pydevd: %s" % ex
        raise
  1. Add next lines to all place where you need to add breakpoints
if REMOTE_DEBUG:
    pydevd.settrace('DEV_IP', port=5678, stdoutToServer=True, stderrToServer=True)

IV. Start flow to trigger breakpoint.

  1. Enable script.
  2. Start authentication process.
  3. Eclipse after executing line with pydevd.settrace should show dialog to selectt scritp source.
  4. After selecting script file it's possible to debug it.

V. Additional sources

  1. http://www.pydev.org/manual_adv_remote_debugger.html