admin管理员组文章数量:1404927
I try to add inspector in my application that embed v8 engine.
All my try failed, so i try to look on node.js implementation : it's to heavy, so i switch to inspector-test and d8 from v8 soucres. But i don't found how connect it to chrome :(
So before continue dev, i will want to establish a debug connection between chrome and a debuggable application like d8 or v8_shell to analyse how it work.
My question : how to connect "inspector-test or d8 or v8_shell" to chrome://inspect/#devices on the same puter.
Thanks for your help
I try to add inspector in my application that embed v8 engine.
All my try failed, so i try to look on node.js implementation : it's to heavy, so i switch to inspector-test and d8 from v8 soucres. But i don't found how connect it to chrome :(
So before continue dev, i will want to establish a debug connection between chrome and a debuggable application like d8 or v8_shell to analyse how it work.
My question : how to connect "inspector-test or d8 or v8_shell" to chrome://inspect/#devices on the same puter.
Thanks for your help
Share Improve this question asked Dec 13, 2017 at 12:42 WCdrWCdr 1855 silver badges12 bronze badges 1- Reformulation : how enable embeded v8 engine debugging using chrome devtool ? I don't use node.js, i already try : d8 code, inspector-test and i read github./v8/v8/wiki/Debugging-over-the-V8-Inspector-API), but i can establish a connection with my code... – WCdr Commented Dec 14, 2017 at 7:17
2 Answers
Reset to default 81 : Be sure to understand this :
=> https://github./v8/v8/wiki/Embedder%27s-Guide (very important)
2 : Compile your own version of v8, the goal is to understand a lot a things (when you found how do this it will be your first victory and you way use prepiled version).
=> Under windows it's a nightmare and you need VS2015 some extra lib.
=> The simple & safe way is to setup an ubuntu virtual machine.
3 : Read the code of D8 (include in v8 source), D for debug and inspector-test .
=> It a minimal debugger (no munication with frontend).
=> Can be done online : https://cs.chromium/chromium/src/v8/src/d8?type=cs&q=InspectorClient+package:%5Echromium$&l=1916
=> https://cs.chromium/chromium/src/v8/test/inspector/inspector-test?q=inspector-te+package:%5Echromium$&l=1
4 : Lock at Node.js source code there's a plete integration of debugger with Chrome as front-end, but the code is connected with node internal framework it's not easy to remove all un-need things...
=> This link may help : https://github./nodejs/node/pull/6792
5 : If you have not a minimal mand line sample that allow you to execute your own java-script file, write it, be sure to handle all error you will known where it crash...
=> This will help : https://github./underscorediscovery/v8-tutorials
6 : When you v8 engine embedded code is ok (no crash) : lock at this it will help you to start :
=> https://github./v8/v8/wiki/Debugging-over-the-V8-Inspector-API
=> https://medium./@hyperandroid/v8-inspector-from-an-embedder-standpoint-7f9c0472e2b7
Warning : javascript is executed on a single thread, and debugger need to run in an other one (v8 task if i remember correctly).
Good luke it's a hard job.
You can use the V8 inspector programmatically in Node.js. E.g., you can write a module that's starting the inspector, runs some code, parses the results from the inspector and so on.
Have a look at this example code:
Demo for collecting code coverage within Node.js
You need Node 9.3 or newer, then run node coverage/demo.js
and open localhost:8080. (For the type profile demo, you need a custom build Node with newer V8.)
本文标签: javascriptEmbed V8 engine debug using chrome devTools and inspector apiStack Overflow
版权声明:本文标题:javascript - Embed V8 engine debug using chrome devTools and inspector api - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744868647a2629494.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论