If I press F5 in Chrome nothing happens but this:
CDT: {"id":34,"method":"Page.reload","params":{"ignoreCache":false}}
V8: {"error":{"code":-32601,"message":"'Page.reload' wasn't found"},"id":34}

V8 does not seem to understand "Log.*", "Page.*", "Emulation.*", 
"Rendering.*", "DOM.*", "CSS.*", etc. messages though we could write logic 
to react accordingly to these kind of commands.
"Runtime.*", "Debugger.*" messages work when they are forwarded from CDT to 
V8.
For example:
CDT: {"id":6,"method":"Runtime.enable"}
V8: {"id":6,"result":{}}
...
CDT: 
{"id":25,"method":"Debugger.setBreakpointByUrl","params":{"lineNumber":0,"url":"1.js","columnNumber":0,"condition":""}}
V8: 
{"id":25,"result":{"breakpointId":"1.js:0:0","locations":[{"scriptId":"26","lineNumber":0,"columnNumber":0}]}}

It looks Chrome never closes the WS connection (except when the inspector 
tab itself is closed) and even the WS pings are sent.

In my application I do not have logic to close the WS connection (except 
when my app quits) and I do not have WS reconnect logic either.



On Tuesday, 4 April 2017 07:08:05 UTC+1, Zac Hansen wrote:
>
> do you have it working if you connect with chrome then refresh chrome that 
> it works?  
>
> When I reconnect to the same embedded v8 app, I get a slightly different 
> set of messages that don't properly set up the debugger the second time.
>
> Thanks.
>
>
> On Thursday, March 23, 2017 at 9:32:15 AM UTC-7, DánielN wrote:
>>
>> Eventually I managed to sort it out. It does not seem to have huge 
>> interest about it but I share it anyway, someone might find it useful.
>> Basically we have to create a web socket server along with our VM that we 
>> want to debug. Anything that comes through the ws connection (commands from 
>> CDT) has to be forwarded to the InspectorClient 
>> (v8_inspector::V8InspectorClient, 
>> v8_inspector::V8InspectorSession::dispatchProtocolMessage method) and 
>> anything (events and responses) that comes from the InspectorFrontend 
>> (v8_inspector::V8Inspector::Channel) has to be sent through the ws 
>> connection. We do not want to touch the JSON messages at all, no need for 
>> parsing. We just forward them to CDT/V8. The tricky bit is the 
>> runMessageLoopOnPause and quitMessageLoopOnPause methods. They have to be 
>> overridden. runMessageLoopOnPause should not return and has to handle 
>> messages until quitMessageLoopOnPause is called. That's it. In CDT we can 
>> see the call stack, scripts, we set break points, whatever. Launch your 
>> browser with --remote-debugging-port=2222 then type 
>> http://localhost:2222/devtools/inspector.html?ws=localhost:2000 
>> (localhost:2000 where the ws server listens) and you can start debugging 
>> your v8 context.
>>
>> On Friday, 3 March 2017 09:41:44 UTC, DánielN wrote:
>>>
>>> I have just started exploring debugging. I am lifting code 
>>> (InspectorClient, InspectorFrontend) from d8 to my test project. I would 
>>> like to connect my embedded v8 VM to CDT and debug it. Does anyone have 
>>> some simple example that does that? It seems to me to be a long way and a 
>>> big learning curve from dismantling d8 code to connect to CDT.
>>> Any help would be very much appreciated.
>>>
>>> On Friday, 3 March 2017 09:21:43 UTC, Ben Noordhuis wrote:
>>>>
>>>> On Fri, Mar 3, 2017 at 10:10 AM, Rishi Kumar <mr.ris...@gmail.com> 
>>>> wrote: 
>>>> > Hi, 
>>>> > 
>>>> > I was reading and using the debugging protocol from this page 
>>>> > https://github.com/v8/v8/wiki/Debugging-Protocol . Its looks like it 
>>>> has 
>>>> > been removed from the github wiki. I dont know how to get that link 
>>>> page to 
>>>> > complete my work. I need these protocol documentation which was clear 
>>>> and 
>>>> > proper in that page link. is anyone can help me to get that ? 
>>>>
>>>> This is the new API: 
>>>> https://github.com/v8/v8/wiki/Debugging-over-the-V8-Inspector-API 
>>>>
>>>> The old JSON-based protocol was deprecated two or three years ago and 
>>>> was removed recently. 
>>>>
>>>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to