debuging drush with xdebug
If the question is how to debug drush, you could use your IDE in the commands file you've got the command in pm.inc most probably, and use xdebug with the idkey, i.e.

xdebug.idekey="PHPSTORM";


See debuging drush with xdebug for more information

Also related: Can Xdebug be triggered by Drush commands?