Remote Debugger

Contents

1. Introduction
2. Configuration

1. Introduction

The remote debugger is a module that makes it easy to plug in different debugging facilities. Debugging is automatically activated using url param debug and can be switched on/off on demand. The module itself is not a debugger, but facilitates calling of diverse debuggers (pdb, gpdb, pydev). This module is meant for Invenio developers and other people who want to edit the Python code, please do not use this module in production environment!.

Debug mode is enabled by passing debug=X in the url parameter, example:

http://invenio-ubu/record/94/keywords?ln=en&debug=3
This will run the web application in an interactive mode, debugger in this case is Eclipse/Pydev.

From the module documentation:

Each debugger has its own number:
local winpdb: debug=1
remote winpdb: debug=2
remote pydev: debug=3

If debug parameter is empty, the code runs normally. You can also
roll out your own debugging functions, assign it new number - look into
get_debugger()

If you want to change behaviour of the debugger interactively, you can
pass arguments encoded in the url, example:
http://someurl/collection/X?debug=3|ip:192.168.31.1|port:9999|stderr:0
look at the method signature of each debugger function to see available
arguments.

2. Configuration

If you want to use the remote debugger for Invenio, then make sure your local remote_debugger_config.py file contains:
CFG_REMOTE_DEBUGGER_ENABLED = 1
And if also want to edit modules while Apache is running and see the results immediately, this will force Apache to reload the changed python modules located inside 'lib/python/invenio' but it will not reload anything if you edit var/www/*.py modules.
CFG_REMOTE_DEBUGGER_WSGI_RELOAD = ['lib/python/invenio/*.py']
For a more detailed configuration and instructions how to activate individual debuggers, please see the comments inside the remote_debugger.py module -- as this module is for developers, I assume you will find it very easy to understand the rest. Note: if you are using winpdb, then you may want to set the number of WSGI processes to 1 in your /opt/invenio/etc/apache/invenio-apache-vhost.conf.