Hi ibon,

 Do you have any sample code base of integrating chrome-dev inspector with 
embedded v8?

Thanks,
-Harsha

On Tuesday, December 20, 2016 at 2:00:50 PM UTC+5:30, ibon tolosana wrote:
>
> Hi Alexey,
>
> thanks for the answer.
>
> I figured out what was happening on my side. Basically a threading issue:
> My app's v8 thread got blocked on runMessageLoopOnPause, so now i make a 
> synchronous runMessageLoopOnPause execution. Before, i was exiting 
> runMessageLoopOnPause to make an asynchronous loop for it, which made 
> debugger breakpoints not work (already left runMessageLoopOnPause). I get 
> now correctly notified on quitMessageLoopOnPause after sinking all 
> inspector messages.
>
> Embedded v8 Inspector integration with chrome dev tools is simply sweet. 
> Thanks for the hard work !!!
>
> Best,
>
> - i
>
> El martes, 20 de diciembre de 2016, 8:47:32 (UTC+1), Alexey Kozyatinskiy 
> escribió:
>>
>> Hi,
>>
>> When JavaScript execution is paused (e.g. breakpoint is triggered) V8 
>> send to inspector (DevTools backend inside of V8) message with v8::Break 
>> type [1]. On this message inspector send via protocol Debugger.paused 
>> notification [2] and call V8InspectorClient::runMessageLoopOnPause method 
>> [3]. Client should run nested message loop and process following protocol 
>> commands from front-end there inside of this function until inspector 
>> doesn't call quitMessageLoopOnPause. When quitMessageLoopOnPause is called 
>> and after client finishes nested message loop then execution will be 
>> returned to inspector code and then JavaScript execution will be resumed.[4]
>> There is no complex logic inside of V8 related to pausing execution - 
>> execution is paused as long as runMessageLoopOnPause is running.
>>
>> You need to write own logic to pause other operations.
>>
>> [1] 
>> https://cs.chromium.org/chromium/src/v8/src/debug/debug.cc?rcl=0&l=1767
>> [2] 
>> https://cs.chromium.org/chromium/src/v8/src/inspector/v8-debugger.cc?rcl=1482193199&l=485
>> [3] 
>> https://cs.chromium.org/chromium/src/v8/src/inspector/v8-debugger.cc?rcl=1482193199&l=491
>> [4] 
>> https://cs.chromium.org/chromium/src/v8/src/inspector/v8-debugger.cc?rcl=1482193199&l=493
>>
>> Thanks,
>> Aleksey.
>>
>> On Monday, December 19, 2016 at 7:32:13 AM UTC-8, ibon tolosana wrote:
>>>
>>> Hi,
>>>
>>> i have successfully integrated remote debugging through chrome dev tools 
>>> to an embedded v8 in an android app. 
>>> I can see v8's loaded source code, do profiling, memory dumps, etc., but 
>>> JS debugging is not working as expected.
>>>
>>> Whenever the debugger hits a breakpoint, the session channel sends a 
>>> `{"method":"Debugger.paused"...` message to dev tools frontend.
>>> After that, InspectorClient has its method `runMessageLoopOnPause` 
>>> called from V8Debugger, and here is where things don't fully work on my 
>>> side.
>>>
>>> The JS execution gets only stopped if I don't exit 
>>> `runMessageLoopOnPause` method. Otherwise, I would get some debugger 
>>> information, like evaluated variables values, but the javascript execution 
>>> is not stopped.
>>>
>>> My project is quite complex, where several different operations are 
>>> wired to javascript, like touch or timers.
>>> I assume all external js calls should be disabled while running 
>>> `runMessageLoopOnPause`, maybe until `quitMessageLoopOnPause` is called ?. 
>>> However, this is just guessing. For a simpler example, where just some 
>>> javascript is compiled and run, w/o threading or external stuff working, 
>>> remote debugger works just fine.
>>>
>>> Could anyone point me to a place where i could read about what i am 
>>> supposed to do on these methods ? Any hints on how to handle debugger 
>>> interaction at this point would be highly appreciated.
>>>
>>> Thanks.
>>>
>>>
>>>

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