-
Notifications
You must be signed in to change notification settings - Fork 6
Debugger Tutorial
First you have to install Eclipse platform from eclipse.org. Eclipse comes in many different configurations, the Debugger requires “Eclipse platform” or richer. You also could give a try to “Eclipse IDE for JavaScript Web Developers” (JSDT) configuration that provides JavaScript IDE, though it has its limitations.
Then you have to install Debugger into Eclipse.
Start Eclipse and open menu Help | Install New Software...
.
Add update site http://chromedevtools.googlecode.com/svn/update/dev/.
You should find “Google Chrome Developer Tools” category in the space below. Under this category choose “Chromium JavaScript Remote Debugger” and optionally debugger bridge to JSDT (only if you have JSDT installed).
Finish installation and restart Eclipse as prompted.
See also HowToInstall.
In Eclipse create a new debug configuration (under Run | Debug Configurations...
) (you might need to switch to the Debug perspective first). Several configuration types are supported for different protocols.
(Note that failing to see these configuration types is very likely a sign of incorrect Java VM version).
This is default Google Chrome/Chromium debug protocol: WebKit Remote Debugging Protocol. You should start browser with the following command-line: chrome --remote-debugging-port=<debug port>
This is for the native V8 debug protocol. There is no standard way to enable it, as V8 is only a library and doesn’t control it. A particular application is [responsible for this].
This is what historically was the first Google Chrome/Chromium debug protocol. It is being phasing out so you probably won’t need it.
Once you chose a configuration type, all other settings should be pretty much the same.
However note that for “WebKit Protocol” you will have to manually choose a backend (see main article).
Then specify the debugger port
you have chosen, in the “Remote” tab.
Press “Debug”. If the browser has multiple tabs opened, a corresponding tab chooser dialog will appear. Unless something went wrong, debugger should attach soon and a new object called launch should appear in Debug view (make sure you are in Debug perspective by now).
Note that you can also connect to other V8-based applications via “Standalone V8 VM” launch type, provide
[]: http://chromedevtools.googlecode.com/svn/wiki/rel034-debug-configurations-remote.png [responsible for this]: http://code.google.com/p/v8/wiki/AddDebuggerSupport