On Sun, Aug 24, 2014 at 12:00 PM, Petar Dobrev <[email protected]> wrote:
> Hello!
>
> I'd like to add debugger support to an application that uses v8 and tried
> following the resource on the topic from the wiki:
> https://code.google.com/p/v8/wiki/AddDebuggerSupport
>
> However, it seems that in v8-debug.h in trunk
> (https://code.google.com/p/v8/source/browse/trunk/include/v8-debug.h) there
> is neither v8::Debug::EnableAgent, nor
> v8::Debug::SetDebugMessageDispatchHandler.
>
> Does anyone know what the current API to achieve that is?

You feed in JSON debug commands[0] with v8::Debug::SendCommand().
It's safe to call from another thread; the main thread will interrupt
currently executing JS code in order to process the debug command.

If the main thread spends most of its time in native code, then call
v8::Debug::ProcessDebugMessages() periodically to flush queued
commands.

Everything else, like creating a listen socket and managing
connections from debugger clients, is up to the embedder.  The wire
representation of the debug protocol looks a lot like HTTP, but with
the notable differences that:

1. There is no status or request line, and

2. The server (the process being debugged) sends headers first.  They
look like this:

  Type: connect
  V8-Version: 3.26.33
  Protocol-Version: 1
  Embedding-Host: node v0.13.0-pre
  Content-Length: 0

It should be noted that V8's native debugger protocol is being phased
out in favor of Chromium's remote debugger protocol; for a longer-term
solution, that's probably what you want to be looking at.

Hope that helps!

[0] https://code.google.com/p/v8/wiki/DebuggerProtocol

[1] https://developer.chrome.com/devtools/docs/debugger-protocol

-- 
-- 
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.

Reply via email to