Reputation: 5314
Chrome's remote debugger is great for connecting to V8-hosting applications which support the V8 remote debugging protocol. However, while several applications that use V8 provide this protocol support, there doesn't appear to be any pre-existing library or the like for adding this protocol support to a new V8-based application stack.
Specifically, I have an NDK application on Android that uses V8 as its scripting engine, and I would like to know the simplest way to enable it for remote debugging support.
I have looked through the V8::Debug API (via v8.h and Doxygen) but it doesn't appear to have any built-in support for the actual wire protocol, and ideally I'd like something that I can just run a socket server on (or better yet, something that Just Works with adb, like with WebView or the like).
Upvotes: 1
Views: 629
Reputation: 3548
V8 used to have an API-accessible debug agent, a component that set up a listening socket and talked to a debugger on behalf of a given isolate.
That API is no longer available, but you can still check out its implementation and build something similar within your V8 host. It's a relatively simple server that exchanges JSON messages with the remote debugger client. V8 still has APIs for processing the messages, so you only have to implement the socket communications.
You can grab some old V8 sources as follows:
svn checkout http://v8.googlecode.com/svn/branches/3.26@24646 v8
Once you have the sources, the debug agent is at v8/src/debug-agent.*
.
Upvotes: 1