Hi,

runMessageLoopOnPause and quitMessageLoopOnPause seems to be working 
correctly. When the debugger is paused using the halt icon on chrome-dev 
tools, runMessageLoopOnPause is called and it is just pumping messages to 
platform and when continued quitMessageLoopOnPause is called and the java 
script execution continues.

I am facing issue with single step, break, step into or step over 
functionality. Debugger is not paused when these methods are hit.
It looks like a synchronization issue between inspector thread and java 
script execution thread.
How to synchronize between JS execution and inspector protocol?

Thanks,
-Harsha

On Monday, May 29, 2017 at 10:42:33 AM UTC+5:30, Anoop R. S. wrote:
>
> Hi Harsha,
> Is it setting the breakpoints by passing 
> "method":"Debugger.setBreakpointByUrl" ? 
> Seems like it is having problems on pausing: pausing at a breakpoint, 
> pausing after singlestep operation. 
> runMessageLoopOnPause function is called when debugger pauses (at a 
> breakpoint, after step over etc) 
>
> https://groups.google.com/forum/#!topic/v8-users/qmr92Cgagg4
>
> Here is my call stack when pause happens after a step over. You can use it 
> for debugging.
>
> > ChromeDbgServer.exe!V8SFWInspector::runMessageLoopOnPause(int 
> contextGroupId)  Line 18 C++
>   v8.dll!v8_inspector::V8Debugger::handleProgramBreak(v8::Local<v8::Context> 
> pausedContext, v8::Local<v8::Object> executionState, v8::Local<v8::Value> 
> exception, v8::Local<v8::Array> hitBreakpointNumbers, bool 
> isPromiseRejection, bool isUncaught)  Line 519 C++
>   v8.dll!v8_inspector::V8Debugger::handleV8DebugEvent(const 
> v8::DebugInterface::EventDetails & eventDetails)  Line 620 C++
>   v8.dll!v8_inspector::V8Debugger::v8DebugEventCallback(const 
> v8::DebugInterface::EventDetails & eventDetails)  Line 540 C++
>   v8.dll!v8::internal::Debug::CallEventCallback(v8::DebugEvent event, 
> v8::internal::Handle<v8::internal::Object> exec_state, 
> v8::internal::Handle<v8::internal::Object> event_data, 
> v8::Debug::ClientData * client_data)  Line 1903 C++
>   v8.dll!v8::internal::Debug::ProcessDebugEvent(v8::DebugEvent event, 
> v8::internal::Handle<v8::internal::JSObject> event_data, bool 
> auto_continue)  Line 1880 C++
>   
> v8.dll!v8::internal::Debug::OnDebugBreak(v8::internal::Handle<v8::internal::Object>
>  
> break_points_hit, bool auto_continue)  Line 1818 C++
>   v8.dll!v8::internal::Debug::Break(v8::internal::JavaScriptFrame * 
> frame)  Line 573 C++
>   v8.dll!v8::internal::__RT_impl_Runtime_DebugBreak(v8::internal::Arguments 
> args, v8::internal::Isolate * isolate)  Line 35 C++
>   v8.dll!v8::internal::Runtime_DebugBreak(int args_length, 
> v8::internal::Object * * args_object, v8::internal::Isolate * isolate) 
>  Line 25 + 0xde bytes C++
>
> Hope I am not too late for the reply.
>
> regards,
> Anoop R. S.
>
> --From Mail
>
>> Hi Anoop,
>>
>>  Thanks for your reply and very sorry for the delay in my reply as I was 
>> on vacation and did not get a chance to work on the inspector code.
>>
>> I fixed issue which was a silly mistake from my end as I was allocating 
>> the agent variable on stack which go cleaned up once the function returned.
>>
>> Now I could establish connection with the chrome-dev tools client and 
>> communicate with the debug server.
>> I am facing an issue here.
>> i) It is not breaking on the first statement, even though I have wait 
>> implemented
>> ii) I can now stop the execution using halt from the chrome-dev tools. 
>> But If I do single-step or step out, the execution just continues (work as 
>> continue instead of single step) and again I have to press halt on 
>> chrome-dev tools to break the execution.
>>
>> If you can take a look at github.com/hsharsha/v8inspector, would 
>> appreciate greatly.
>>
>> Thanks,
>> -Harsha
>>
>> On Thu, May 18, 2017 at 1:35 PM, Anoop R. S. wrote:
>>
>>> Hi Harsha,
>>> We also developed a debugging framework for JS using V8 inspector. While 
>>> doing that, in between we were also getting this error, but resolved it by 
>>> debugging our code. 
>>> I can send you the websocket messages that we are getting. Maybe that 
>>> would help in some way.
>>> I haven't run your code provided at [
>>> https://github.com/hsharsha/v8inspector]. Maybe if you need further 
>>> help, I can check it.
>>>
>>>
>>> {"id":1,"method":"Log.enable"}
>>>
>>>
>>> {"id":2,"method":"Log.startViolationsReport","params":{"config":[{"name":"longTask","threshold":200},{"name":"longLayout","threshold":30},{"name":"blockedEvent","threshold":100},{"name":"blockedParser","threshold":-1},{"name":"handler","threshold":150},{"name":"recurringHandler","threshold":50}]}}
>>>
>>>
>>> {"id":3,"method":"Network.enable","params":{"maxTotalBufferSize":10000000,"maxResourceBufferSize":5000000}}
>>>
>>> {"id":4,"method":"Page.enable"}
>>>
>>> {"id":5,"method":"Page.getResourceTree"}
>>>
>>> {"id":6,"method":"Runtime.enable"}
>>>
>>> {"id":7,"method":"Debugger.enable"}
>>>
>>>
>>> {"id":8,"method":"Debugger.setPauseOnExceptions","params":{"state":"none"}}
>>>
>>>
>>> {"id":9,"method":"Debugger.setAsyncCallStackDepth","params":{"maxDepth":0}}
>>>
>>> {"id":10,"method":"DOM.enable"}
>>>
>>> {"id":11,"method":"CSS.enable"}
>>>
>>>
>>> {"id":12,"method":"Target.setAutoAttach","params":{"autoAttach":true,"waitForDebuggerOnStart":true}}
>>>
>>> {"id":13,"method":"Profiler.enable"}
>>>
>>>
>>> {"id":14,"method":"Profiler.setSamplingInterval","params":{"interval":100}}
>>>
>>> {"id":15,"method":"ServiceWorker.enable"}
>>>
>>> {"error":{"code":-32601,"message":"'Log.enable' wasn't found"},"id":1}
>>>
>>> {"error":{"code":-32601,"message":"'Log.startViolationsReport' wasn't 
>>> found"},"id":2}
>>>
>>> {"error":{"code":-32601,"message":"'Network.enable' wasn't 
>>> found"},"id":3}
>>>
>>> {"error":{"code":-32601,"message":"'Page.enable' wasn't found"},"id":4}
>>>
>>> {"error":{"code":-32601,"message":"'Page.getResourceTree' wasn't 
>>> found"},"id":5}
>>>
>>>
>>> {"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"origin":"","name":""}}}
>>>
>>> {"id":6,"result":{}}
>>>
>>>
>>> {"method":"Debugger.scriptParsed","params":{"scriptId":"22","url":"my_Screen1","startLine":0,"startColumn":0,"endLine":19,"endColumn":0,"executionContextId":1,"hash":"FF07566204EF7A37E97781F777DD9282456E48B3","isLiveEdit":false,"sourceMapURL":"","hasSourceURL":false}}
>>>
>>>
>>> {"id":22,"method":"Debugger.setBreakpointByUrl","params":{"lineNumber":13,"url":"my_Screen1","columnNumber":39,"condition":""}}
>>>
>>> {"id":7,"result":{}}
>>>
>>> {"id":8,"result":{}}
>>>
>>> {"id":9,"result":{}}
>>>
>>> {"error":{"code":-32601,"message":"'DOM.enable' wasn't found"},"id":10}
>>>
>>> {"error":{"code":-32601,"message":"'CSS.enable' wasn't found"},"id":11}
>>>
>>> {"error":{"code":-32601,"message":"'Target.setAutoAttach' wasn't 
>>> found"},"id":12}
>>>
>>> {"id":13,"result":{}}
>>>
>>> {"id":14,"result":{}}
>>>
>>> {"error":{"code":-32601,"message":"'ServiceWorker.enable' wasn't 
>>> found"},"id":15}
>>>
>>> {"id":16,"result":{}}
>>>
>>> {"error":{"code":-32601,"message":"'Page.setAutoAttachToCreatedPages' 
>>> wasn't found"},"id":17}
>>>
>>> {"error":{"code":-32601,"message":"'Emulation.setScriptExecutionDisabled' 
>>> wasn't found"},"id":18}
>>>
>>> {"error":{"code":-32601,"message":"'Rendering.setShowViewportSizeOnResize' 
>>> wasn't found"},"id":19}
>>>
>>> {"error":{"code":-32601,"message":"'Inspector.enable' wasn't 
>>> found"},"id":20}
>>>
>>> {"id":21,"result":{}}
>>>
>>>
>>> {"id":22,"result":{"breakpointId":"my_Screen1:13:39","locations":[{"scriptId":"22","lineNumber":13,"columnNumber":39}]}}
>>>
>>> Please let me know if this is of any help for you.
>>>
>>> regards,
>>> Anoop R. S.
>>>
>>> On Monday, 8 May 2017 20:01:43 UTC+5:30, Harsha HS wrote:
>>>>
>>>> Hi,
>>>> I am trying to use chrome protocol with chrom-devtools in front end.
>>>> I am not receiving any message from frontend after id:8
>>>>
>>>>  message {"id":1,"method":"Runtime.enable"}
>>>>  message {"id":2,"method":"Debugger.enable"}
>>>>  message 
>>>> {"id":3,"method":"Debugger.setPauseOnExceptions","params":{"state":"none"}}
>>>>  message 
>>>> {"id":4,"method":"Debugger.setAsyncCallStackDepth","params":{"maxDepth":0}}
>>>>  message {"id":5,"method":"Profiler.enable"}
>>>>  message 
>>>> {"id":6,"method":"Profiler.setSamplingInterval","params":{"interval":100}}
>>>>  message 
>>>> {"id":7,"method":"Debugger.setBlackboxPatterns","params":{"patterns":[]}}
>>>> message {"id":8,"method":"Runtime.runIfWaitingForDebugger"}
>>>>
>>>> For each of these messages, I am replying to frontend with {id:xx, 
>>>> result:{}}.
>>>>
>>>> Code is at https://github.com/hsharsha/v8inspector
>>>>
>>>> -Harsha
>>>>
>>> …
>>
>
> On Thursday, 18 May 2017 13:35:15 UTC+5:30, Anoop R. S. wrote:
>>
>> Hi Harsha,
>> We also developed a debugging framework for JS using V8 inspector. While 
>> doing that, in between we were also getting this error, but resolved it by 
>> debugging our code. 
>> I can send you the websocket messages that we are getting. Maybe that 
>> would help in some way.
>> I haven't run your code provided at [
>> https://github.com/hsharsha/v8inspector]. Maybe if you need further 
>> help, I can check it.
>>
>>
>> {"id":1,"method":"Log.enable"}
>>
>>
>> {"id":2,"method":"Log.startViolationsReport","params":{"config":[{"name":"longTask","threshold":200},{"name":"longLayout","threshold":30},{"name":"blockedEvent","threshold":100},{"name":"blockedParser","threshold":-1},{"name":"handler","threshold":150},{"name":"recurringHandler","threshold":50}]}}
>>
>>
>> {"id":3,"method":"Network.enable","params":{"maxTotalBufferSize":10000000,"maxResourceBufferSize":5000000}}
>>
>> {"id":4,"method":"Page.enable"}
>>
>> {"id":5,"method":"Page.getResourceTree"}
>>
>> {"id":6,"method":"Runtime.enable"}
>>
>> {"id":7,"method":"Debugger.enable"}
>>
>>
>> {"id":8,"method":"Debugger.setPauseOnExceptions","params":{"state":"none"}}
>>
>>
>> {"id":9,"method":"Debugger.setAsyncCallStackDepth","params":{"maxDepth":0}}
>>
>> {"id":10,"method":"DOM.enable"}
>>
>> {"id":11,"method":"CSS.enable"}
>>
>>
>> {"id":12,"method":"Target.setAutoAttach","params":{"autoAttach":true,"waitForDebuggerOnStart":true}}
>>
>> {"id":13,"method":"Profiler.enable"}
>>
>>
>> {"id":14,"method":"Profiler.setSamplingInterval","params":{"interval":100}}
>>
>> {"id":15,"method":"ServiceWorker.enable"}
>>
>> {"error":{"code":-32601,"message":"'Log.enable' wasn't found"},"id":1}
>>
>> {"error":{"code":-32601,"message":"'Log.startViolationsReport' wasn't 
>> found"},"id":2}
>>
>> {"error":{"code":-32601,"message":"'Network.enable' wasn't found"},"id":3}
>>
>> {"error":{"code":-32601,"message":"'Page.enable' wasn't found"},"id":4}
>>
>> {"error":{"code":-32601,"message":"'Page.getResourceTree' wasn't 
>> found"},"id":5}
>>
>>
>> {"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"origin":"","name":""}}}
>>
>> {"id":6,"result":{}}
>>
>>
>> {"method":"Debugger.scriptParsed","params":{"scriptId":"22","url":"my_Screen1","startLine":0,"startColumn":0,"endLine":19,"endColumn":0,"executionContextId":1,"hash":"FF07566204EF7A37E97781F777DD9282456E48B3","isLiveEdit":false,"sourceMapURL":"","hasSourceURL":false}}
>>
>>
>> {"id":22,"method":"Debugger.setBreakpointByUrl","params":{"lineNumber":13,"url":"my_Screen1","columnNumber":39,"condition":""}}
>>
>> {"id":7,"result":{}}
>>
>> {"id":8,"result":{}}
>>
>> {"id":9,"result":{}}
>>
>> {"error":{"code":-32601,"message":"'DOM.enable' wasn't found"},"id":10}
>>
>> {"error":{"code":-32601,"message":"'CSS.enable' wasn't found"},"id":11}
>>
>> {"error":{"code":-32601,"message":"'Target.setAutoAttach' wasn't 
>> found"},"id":12}
>>
>> {"id":13,"result":{}}
>>
>> {"id":14,"result":{}}
>>
>> {"error":{"code":-32601,"message":"'ServiceWorker.enable' wasn't 
>> found"},"id":15}
>>
>> {"id":16,"result":{}}
>>
>> {"error":{"code":-32601,"message":"'Page.setAutoAttachToCreatedPages' 
>> wasn't found"},"id":17}
>>
>> {"error":{"code":-32601,"message":"'Emulation.setScriptExecutionDisabled' 
>> wasn't found"},"id":18}
>>
>> {"error":{"code":-32601,"message":"'Rendering.setShowViewportSizeOnResize' 
>> wasn't found"},"id":19}
>>
>> {"error":{"code":-32601,"message":"'Inspector.enable' wasn't 
>> found"},"id":20}
>>
>> {"id":21,"result":{}}
>>
>>
>> {"id":22,"result":{"breakpointId":"my_Screen1:13:39","locations":[{"scriptId":"22","lineNumber":13,"columnNumber":39}]}}
>>
>> Please let me know if this is of any help for you.
>>
>> regards,
>> Anoop R. S.
>>
>> On Monday, 8 May 2017 20:01:43 UTC+5:30, Harsha HS wrote:
>>>
>>> Hi,
>>> I am trying to use chrome protocol with chrom-devtools in front end.
>>> I am not receiving any message from frontend after id:8
>>>
>>>  message {"id":1,"method":"Runtime.enable"}
>>>  message {"id":2,"method":"Debugger.enable"}
>>>  message 
>>> {"id":3,"method":"Debugger.setPauseOnExceptions","params":{"state":"none"}}
>>>  message 
>>> {"id":4,"method":"Debugger.setAsyncCallStackDepth","params":{"maxDepth":0}}
>>>  message {"id":5,"method":"Profiler.enable"}
>>>  message 
>>> {"id":6,"method":"Profiler.setSamplingInterval","params":{"interval":100}}
>>>  message 
>>> {"id":7,"method":"Debugger.setBlackboxPatterns","params":{"patterns":[]}}
>>> message {"id":8,"method":"Runtime.runIfWaitingForDebugger"}
>>>
>>> For each of these messages, I am replying to frontend with {id:xx, 
>>> result:{}}.
>>>
>>> Code is at https://github.com/hsharsha/v8inspector
>>>
>>> -Harsha
>>>
>>

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