It's possible to initiate remote XDEBUG debugging sessions by appending ?XDEBUG_SESSION_START to a Drupal URL, as per:
Does anyone have any objections to a module that does this automatically, and provides a block with a tick box that would effectively turn debugging mode on or off? Or is there a module that already provides this functionality?