Macro to start remote debugging for current file

I use the following Komodo JavaScript macro for kicking off a remote debugging session for a remote python file I have opened in Komodo, opened usually over SFTP or SCP. It will kick off the remote dbgp debugger and connect to your running Komodo.

Note: You need to set the hostname initially, as I could not find a good way to grab the local hostname from javascript.

function runRemoteDebug(){// Bit of a hack to get the info we needvar RFService = Components.classes["@activestate.com/koRemoteConnectionService;1"].getService(Components.interfaces.koIRemoteConnectionService)try{var connection = RFService.getConnectionUsingUri(komodo.document.file.URI);}catch(ex){alert("Currently opened file is not a supported remote file");return;}

Yes, this may eventually be rolled into the Komodo debug menu (likely after Komodo 4.2) and be integrated to use the existing Komodo connection manager. The ability is there currently for this, but the API's and architecture need work to make this easily accessible.