All Projects → romanvm → kodi.web-pdb

romanvm / kodi.web-pdb

Licence: other
Web-based remote Python debugger for Kodi addons

Programming Languages

python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to kodi.web-pdb

console
a debugger for async rust!
Stars: ✭ 2,101 (+2778.08%)
Mutual labels:  debugger
repository.dobbelina
repository.dobbelina- Kodi is a registered trademark of the XBMC Foundation.We are not connected to or in any other way affiliated with Kodi
Stars: ✭ 161 (+120.55%)
Mutual labels:  kodi
Love-Debug-Graph
An fps/memory/misc graph utillity for Löve2D
Stars: ✭ 29 (-60.27%)
Mutual labels:  debugger
youtube-to-XBMC
[WebExtension] Kassi Share - Send YouTube videos to XBMC
Stars: ✭ 21 (-71.23%)
Mutual labels:  kodi
vscode-android-webview-debug
Debug your JavaScript code running in WebViews on any Android device from VS Code.
Stars: ✭ 18 (-75.34%)
Mutual labels:  debugger
Devel-Camelcadedb
Perl module for debugging with Perl5 plugin for IntelliJ
Stars: ✭ 23 (-68.49%)
Mutual labels:  debugger
apollo
microcontroller-based FPGA / JTAG programmer
Stars: ✭ 32 (-56.16%)
Mutual labels:  debugger
kodi-plugin-routing
A routing module for kodi plugins
Stars: ✭ 34 (-53.42%)
Mutual labels:  kodi
gdb
Go GDB/MI interface
Stars: ✭ 70 (-4.11%)
Mutual labels:  debugger
ps2rd
Collection of tools to remotely debug PS2 games
Stars: ✭ 55 (-24.66%)
Mutual labels:  debugger
cc-tool
Mirror of cc-tool from SourceForge
Stars: ✭ 144 (+97.26%)
Mutual labels:  debugger
plugin.video.tv3.cat
Kodi addon
Stars: ✭ 16 (-78.08%)
Mutual labels:  kodi
Rapier
Rapier skin for Kodi entertainment center
Stars: ✭ 19 (-73.97%)
Mutual labels:  kodi
stylish-log
🎉 Stylish-log "A beautiful way to see your web console logs"
Stars: ✭ 12 (-83.56%)
Mutual labels:  debugger
PlexKodiConnect
Plex integration in Kodi done right
Stars: ✭ 917 (+1156.16%)
Mutual labels:  kodi
app
Buggregator is a beautiful, lightweight debug server build on Laravel that helps you catch your smpt, sentry, var-dump, monolog, ray outputs. It runs without installation on multiple platforms.
Stars: ✭ 259 (+254.79%)
Mutual labels:  debugger
kodi
KODI Addons Project
Stars: ✭ 48 (-34.25%)
Mutual labels:  kodi
addon-check
Automatic checks for new repository submissions
Stars: ✭ 45 (-38.36%)
Mutual labels:  kodi
DeezerKodi
Deezer client for Kodi
Stars: ✭ 15 (-79.45%)
Mutual labels:  kodi
react-native-debug-console
A network and console debug component and modal for react native purely in JavaScript
Stars: ✭ 17 (-76.71%)
Mutual labels:  debugger

script.module.web-pdb

script.module.web-pdb is a port of my Web-PDB Python package modified for using in Kodi mediacenter. It is a web-interface for Python's built-in PDB debugger that can be used for remote debugging of Python addons in vivo, that is, while running inside Kodi. Except for modifications needed to run inside Kodi, all other Web-PDB/PDB functionality is left intact so you can use all available documentation and tutorials for the PDB debugger to learn how to debug your Python code.

Web-PDB screenshot

Web-PDB console in Chrome browser

Usage

First you need to install script.module.web-pdb addon in your Kodi instance where you want to debug your addon. The addon can be installed from the Kodi official addon repository: Kodi Add-on repository > Program add-ons > Web-PDB. Also an installable ZIP can be downloaded from Releases tab of this repository.

Then include script.module.web-pdb in your addon.xml as a dependency:

<requires>
  ...
  <import addon="script.module.web-pdb" />
</requires>

Restart Kodi so that it re-reads addon dependencies.

Insert the following line into your addon code at the point where you want to start debugging:

import web_pdb; web_pdb.set_trace()

The set_trace() call will suspend your addon and open a web-UI at the default port 5555 (port value can be changed). At the same time a notification will be displayed in Kodi, indicating that a debug session is active. The notification also shows web-UI host/port.

Kodi notification

Notification in Kodi about an active Web-PDB debugging session

Enter in your the address bar of your browser: http://<your Kodi machine hostname or IP>:5555, for example http://monty-python:5555. Use 127.0.0.1 or localhost as hostname if you are connecting from the same machine that runs Kodi. If everything is OK, you should see the Web-PDB UI like on the preceding screenshot. Now you can use all PDB commands and features. Additional Current file, Globals and Locals information boxes help you better track your program runtime state.

Multiple set_trace() calls can be used as hardcoded breakpoints.

Note: it is strongly recommended to work with the Web-PDB web-UI only in one browser session. With more than one browser window accessing the web-UI it can display incorrect data in one or more browser sessions.

Additionally, Web-PDB provides catch_post_mortem context manager that can catch unhandled exceptions raised within its scope and automatically start PDB post-mortem debugging session. For example:

import web_pdb

with web_pdb.catch_post_mortem():
    # Some error-prone code
    raise RuntimeError('Oops!')

For more detailed info about the Web-PDB API read docstrings in the /libs/web_pdb/__init__.py file.

Introductory video (courtesy of Michele Lombardo): https://www.youtube.com/watch?v=6gMmeA7UY18

My video tutorial for debugging Python addons for Kodi with Web-PDB: https://youtu.be/OukjNpafNZU

Note: Non-bundled front-end JavaScript/CSS source code is available in the frontend directory.

License

MIT license, see LICENSE.txt.

The debugger icon made by Freepik from www.flaticon.com is licensed by CC 3.0 BY.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].