On Thu, Oct 30, 2014 at 12:08 AM, Mark Tarrabain <[email protected]> wrote: > Somebody, please help! > > lineprocessor.cc, which is referred to by the wiki at > https://code.google.com/p/v8/wiki/AddDebuggerSupport, doesn't seem to > contain any references at all to the v8::Debug class. The wiki itself > refers to using the function v8::Debug::EnableAgent, but this function does > not seem to exist in the declaration of v8::Debug. I'm finding myself so > completely lost that I don't even have the words for it. > > Can anyone please point me in the direction of either an explanation that is > reflective of how the code actually exists today, or else examples of how to > use the debugger facilities in v8?
The basic mode of operation is where you feed the debugger commands with v8::Debug::SendCommand(). The protocol is described here: https://code.google.com/p/v8/wiki/DebuggerProtocol v8::Debug::SendCommand() is thread-safe (you can call it from a different thread than the one executing JS) but not async signal-safe (you can't call it from a signal handler.) You can interrupt a running script by calling v8::Debug::DebugBreak() from another thread. It's de facto async signal-safe if, perhaps, not de jure; that is, I don't know whether V8 guarantees that it's async signal-safe but the current implementation is. You can do more advanced things programmatically with v8::Debug::SetDebugEventListener() and v8::Debug::SetMessageHandler(). See test/cctest/test-debug.cc for more details. V8 used to have an embedded debug agent that created a TCP listen socket for clients to connect to. That was removed recently, you have to implement your own now. -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
