My current IDE of choice, Komodo, brings native support for the DBGp protocol to debug source code either locally or from a remote server. It has however some issues with its path mapping implementation.

Since it’s not the first time I stumbled upon this kind of issue (my previous Eclipse PDT experience was troublesome too) I finally tried to solve it. The solution is an intercepting proxy server which listen for connection from the debugger to modify the messages it sends to the IDE with custom path mappings.

To define the path mappings we use a file with a set of paths on each line. The path tuples are separated by the => operator, placing the path understood by the debugger on the left side and on the right the path as understood by the IDE. The file looks like this.


  # Mapping for projects
  file:///var/www/projects => file:///c:/documents%20and%20settings/drslump/projects
  # this one is for my subdomains
  file:///var/www/subdomains => file:///c:/subdomains

The path mappings are case insensitive to avoid problems on Windows.

To run the path mapper server we just need to call it from a terminal like so:

  php5 dbgp-mapper.php -i 192.168.0.5 -m dbgp.map

The -i option specifies the IP or host of the computer where the IDE is running, while the -m option points to the file where the path mappings are defined. There are also other options which you can check by seeing the help using the -h argument.

By default it will bind itself to the port 9000, which is DBGp default one, so if you are running this on the same computer as your IDE you will have to change the port either in this tool or on your IDE.

The source is available via this subversion repository

Update: It seems that Komodo uri mapping works properly after version 4.2.0. In my case I was having problems but after rebooting the system it started to work properly.


Leave a comment

Help

Note to spammers: You are not welcome here, we are committed to fight spam and we will combat it actively. If you think that posting some links here could improve your PR, think twice before doing it because we won't tolerate any abuse


You can use Textile markup to format the comment.

  • _emphasis_
  • *strong*
  • ??citation??
  • -deleted text-
  • +inserted text+
  • ^superscript^
  • @ code @
  • "google":http://google.com
  • AIA(An Invented Acronym)
Either your real name or your nickname
We hate spammers, rest assure that we won't publish your email address
If you happen to have a website you can put it here so others can know more about you
Uncheck if you do not want your browser to remember the current data