在 JVM 中运行时如何调试 J2V8/node.js? [英] How can I debug J2V8/node.js when running within JVM?

查看:49
本文介绍了在 JVM 中运行时如何调试 J2V8/node.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,我使用节点检查器(https://github.com/node-inspector/node-inspector) 来调试 node.js.这可以用于通过 J2V8 附加到在 JVM 中运行的远程 node.js 实例吗?

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?

此外,node.js 的 dev 版本似乎支持原生 Chrome 调试:https://github.com/nodejs/node/pull/6792.如果 J2V8 采用这个版本的 node.js,我是否可以简单地将 Chrome 调试器直接附加到 JVM?

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?

推荐答案

如果问题仍然相关 - 我已经创建了 j2v8-debugger 库.

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

它允许使用 Chrome DevTools 调试 J2V8.

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.

它使用 Stetho 库与 Chrome DevTools 通信.

It uses Stetho lib for communication with Chrome DevTools.

它也使用 DebugHandler 来访问 V8 调试信息.

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

如果您需要调试运行在非 Android JVM 上的 J2V8,您将需要使用另一个库与 Chrome DevTools 进行通信,但您可能可以重用该项目中的所有逻辑,因为它基本上是 POJO/JSON,它们通过网络套接字发送.

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.

希望能帮到你.

这篇关于在 JVM 中运行时如何调试 J2V8/node.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆