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

2019-07-30 07:01发布

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?

标签: node.js v8 j2v8
1条回答
不美不萌又怎样
2楼-- · 2019-07-30 07:33

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.

查看更多
登录 后发表回答