As Jey writes V8 has a JSON-based debugger protocol which is intended for out-of-process debugging. Currently there is no sample which uses this protocol, but you might be able to find some inspiration and information from looking at some of the test code in test/mjsunit/debug-* and test/cctest/test-debug.cc. Note that when looking at the interface in include/v8-debug.h there are two ways of hooking up a debugger. One for an in-process debugger where the AddDebugEventListener() method is used to register a function to be called when a debug event occours. The other interface is the JSON-based message based where the SetMessageHandler() is used to register a function receiving JSON-formatted messages on the debug events and SendCommand() is used to send JSON-formatted commands to the debugger.
For both approaches the method DebugBreak() can be used to force JavaScript execution to stop as soon as possible to issue a debugger break event. Also not that V8 supports the JavaScript statement "debugger" which also causes a break into the debugger. The command line based JavaScript debugger in Chromium (and Google Chrome) is build using the JSON-based debugger protocol. Regards, Søren On Mon, Sep 15, 2008 at 10:03 PM, Jey Kottalam <[EMAIL PROTECTED]>wrote: > > On Mon, Sep 15, 2008 at 12:59 PM, <[EMAIL PROTECTED]> wrote: > > > > Something like a port on VM to attach a debugger to. Maybe there are > > already similar tools? > > > > V8 has a nifty JSON-based debugger protocol that you can write a > client for. Look at v8/include/v8-debug.h and v8/src/debug-delay.js > > -Jey > > > > --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
