Debugger

Starting with eXist-db release 1.4 the database provides an facility to debug xquery code on the server. This document descibes how to build this extension, and how to configure your editor to work with the extension.

1. Compile

The following steps are required to enable the debugger interface:

  1. Enable the debugger in extensions/build.properties: set include.feature.debugger to true.

  2. Download the required jar files.

  3. Recompile eXist-db:

    build.sh

2. Setup your editor

Currently two editors can use the debugger interface: Emacs and VIM.

2.1. Emacs

First you need to install geben. When installed you can start geben with "Meta-x geben"

Run your XQuery script in the debug mode: http://www.example.com/script.xql?XDEBUG_SESSION_START or you can use the Xdebug Helper add-on for Firefox.

If every thing was done correct you should see script.xql. Available commands are:

spc

step into/step over

i

step into

o

step over

r

step out

b

set a breakpoint at a line

u

unset a breakpoint at a line

g

run

q

stop

2.2. VIM

To debug with vim you have to install the remote debugger interface for the DBGp protocol. In the editor you can press <F5> and browse xquery file in debug mode within 5 seconds

September 2009
Dmitriy Shabanov