How can I debug J2V8/node.js when running within JVM?

∥☆過路亽.° 提交于 2019-12-11 04:40:26

问题


Typically, I use node inspector (https://github.com/node-inspector/node-inspector) to debug node.js. Can this be used to attach to a remote node.js instance running in the JVM via J2V8?

Also, it looks like the dev version of node.js supports native Chrome debugging: https://github.com/nodejs/node/pull/6792. If J2V8 adopts this version of node.js, will I be able to simply attach the Chrome debugger directly to the JVM?


回答1:


If the question is still relevant - I have created j2v8-debugger library.

It allows debugging J2V8 using Chrome DevTools.

Basic features like setting/removing breakpoints, step into, step out and step over, variables inspection, etc. are implemented.

It uses Stetho lib for communication with Chrome DevTools.

Also it's uses DebugHandler for accessing V8 debug information.

If you need need to debug J2V8, which runs on non-Android JVM you would need to use another lib for communication to Chrome DevTools, but likely you could re-use all the logic from this project as it's basically POJO/JSON, which are send over web socket.

Hope it could be helpful.



来源:https://stackoverflow.com/questions/38660656/how-can-i-debug-j2v8-node-js-when-running-within-jvm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!