A debugger interface for Sublime Text 2, providing an easy way to wire up a variety of debuggers with rich UI. Included is a debugger for v8.
SUUUUPER experimental! Consider this a proof-of-concept!
Clone this repository into your Packages directory.
To find your Packages path, bring up the console with ctrl-`
and enter:
print sublime.packages_path()
You'll likely need to restart Sublime Text 2 to get the plugin.
The debugger requires some settings to function - namely, what you want to debug. I recommend making these settings per-project, however you can make them global defaults as well.
From the Project
menu select Edit Project
, add or merge the following:
"settings":
{
"debug_target": "v8://localhost:5858"
}
The provider URI is the target of the debugger. In the future I'll make it more flexible/add more providers/etc.
When launching your node.js app, add --debug=5858
to the command line:
node --debug=5858 my_script.js
Right click in a ST view and select 'Attach Debugger' to start debugging!
More UI/etc is TODO, but for now you can use the Command Palette
(ctrl-shift-P
) with the prefix Debugger:
to access most commands. The
following keyboard shortcuts are recognized:
- F5: launch debugger
- shift-F5: attach debugger
- F8: pause/resume target, continue if broken
- F9: add/remove a breakpoint
- shift-F9: enable/disable a breakpoint
- F10: step over next instruction
- F11: step in to next call
- shift-F11: step out of current scope
TODO
TODO
TODO
TODO
AKA 'edit-and-continue'. This pretty much works right now so long as you don't make changes that V8 is unable to handle, such as adding/removing functions, changing scopes, etc. Reporting for failures is TODO.
TODO: support script mapping so DART/coffeescript?/etc work
Working!
- node.js command line:
node --debug=5858 script.js
- Project setting:
debug_target: "v8://localhost:5858"
Partially implemented; not yet working.
- Chrome command line:
chrome --remote-debugging-port=9222
- Project setting:
debug_target: "webkit://localhost:9222"
It'd be cool to plug in other runtimes that have remote debuggers. It's easy to add them, so go contribute!
- V8 Debugger Protocol
- Chrome Debugger Protocol
- WebKit Protocol
- V8 debug-agent.cc
- V8 debug-debugger.js
- node.js _debugger.js
- WebInspector source
- V8 ScriptDebugServer.cpp
Have a fix or feature? Submit a pull request - I love them!
As this is a Google project, you must first e-sign the Google Contributor License Agreement before I can accept any code. It takes only a second and basically just says you won't sue us or claim copyright of your submitted code.
All code except dependencies under third_party/ is licensed under the permissive Apache 2.0 license. Feel free to fork/rip/etc and use as you wish!