Release script.module.remote-pdb: a remote debugger for addon developers
#1
script.module.remote-pdb is a remote (telnet) interface to Python's built-in PDB debugger. It is based on remote-pdb package with several changes needed for running inside Kodi. All core debugging functionality is left intact.

script.module.remote-pdb allows you debug your Python addons remotely when they are running inside Kodi.

Usage:

1. Download an installable ZIP from this page and install it in your Kodi instance.

2. Add script.module.remote-pdb to your addon.xml as a dependency:

Code:
<requires>
  ...
  <import addon="script.module.remote-pdb" version="1.2"/>
</requires>

3. Insert the following line in your code at the place where you want to start debugging from:

Code:
from remote_pdb import set_trace; set_trace(host='', port=5555)

You can use another port if you like.
After hitting the first set_trace call script.module.remote-pdb will suspend your addon execution and wait for a remote telnet connection. At the same time a notification will be displayed inside Kodi with a hostname and a port to connect to. Subsequent set_trace() calls (without arguments) can be used as hardcoded breakpoints.

4. Connect to the remote debugger using a telnet client:

Code:
telnet <your kodi hostname or IP> 5555

On Linux a telnet client is available out of the box, and on Windows I'd recommend to use PuTTY utility in "Raw" mode.
The telnet client will connect to the remote debugger and open a PDB console where you can use all PDB features to debug your addon.

Warning: when you finish your debugging, don't forget to remove script.module.remote-pdb from your addon dependencies and set_trace call(-s) from the code.

Links:
script.module.remote-pdb GitHub repo: https://github.com/romanvm/kodi.remote-pdb
The original remote-pdb package: https://github.com/ionelmc/python-remote-pdb
The official PDB documentation: https://docs.python.org/2/library/pdb.html
A PDB tutorial: https://pythonconquerstheuniverse.wordpr...-in-python
Reply
#2
Sounds pretty useful. Thank you for this.
Reply
#3
Thanks. In fact, I didn't stop on that and developed my own remote debugger with a web-interface: https://github.com/romanvm/python-web-pdb
And this is a port for Kodi: https://github.com/romanvm/kodi.web-pdb. I'm still making final touches but it seems pretty stable at this point. I'll create a separate topic for it when it's ready. My debugger is also based on Python's built-in PDB (it's available out of the box, after all), but with several convenience features.
Reply

Logout Mark Read Team Forum Stats Members Help
script.module.remote-pdb: a remote debugger for addon developers0