I got to playing a bit this evening with the debugger.
Found something interesting (at least, to me) regarding debugging CLI -aka- drush scripts.

Add this line to ~/.profile
XDEBUG_CONFIG="idekey=netbeans-xdebug"

Write your script like any other code.
set your breakpoint the same as for browser.
hit the "Debug Project" buttom (same as for browser).
It will launch the browser if it isn't running... but that is irrelevant.
now, go to your command line and type something like.
# drush scr -u 1 test.php
if 'test.php' is the name of your php script, you are in debug mode.
Great way to look at any of the objects, since drush fully bootstraps Drupal.
I've been having a good time just tinkering with it.

The ONLY thing I think you need to add for the next release, is the 'XDEBUG_CONFIG' variable in .profile.
Everything else is just procedural.

I found a YouTube video with all the right clues here: http://ruilima.com/2011/03/php-cli-xdebug-with-netbeans/

Comments

mike stewart’s picture

Title: How to debug Drush » How to debug Drush: add 'XDEBUG_CONFIG' variable in .profile
Assigned: Unassigned » mike stewart
Category: feature » task
mike stewart’s picture

Assigned: mike stewart » Unassigned