节点检查器可以在不暂停的情况下调试应用程序吗? [英] Can node-inspector debug an app without pausing it?

查看:124
本文介绍了节点检查器可以在不暂停的情况下调试应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

节点检查器是调试服务器端代码的好工具,就像使用Chrome开发人员工具一样。我正在使用它来调试流星服务器,如 http://stackoverflow.com/a/19438774/586086

Node-inspector is a fantastic tool for debugging server-side code just as one would use the Chrome developer tools. I'm using it to debug a Meteor server, as in http://stackoverflow.com/a/19438774/586086.

有一件事情会更好,就是能够在应用运行时使用调试控制台来检查对象,而不会暂停它

One thing that would be even better would be to be able to use the debugging console to inspect objects while the app is running, without pausing it, as allowed by the Chrome developer tools. Currently, if one tries to do this without pausing, the following type of error is displayed:

似乎应该有一种方式来复制Chrome的客户端调试功能,由将检查代码插入到Node事件循环中,而不是暂停执行。有人知道这是否可行?

It seems that there should be a way to replicate the client-side debugging functionality that Chrome has, by inserting the inspection code into the Node event loop, instead of pausing to do it. Does anyone know if this is possible?

推荐答案

免责声明:我是Node Inspector的维护者。

Disclaimer: I am the maintainer of Node Inspector.

Node Inspector使用的V8调试器协议不支持在程序运行时检查对象。 (嗯,它允许您检查一个对象,但是您无法检查检查结果。)Chrome Developer Tools应用了一种解决方法,他们将自己的JavaScript代码注入到网页中,并使用注入的代码执行检查

The V8 debugger protocol used by Node Inspector does not support inspecting objects while the program is running. (Well, it allows you to inspect an object, but you can't inspect the result of the inspection.) Chrome Developer Tools apply a workaround, they are injecting their custom javascript code into the web page and using this injected code to perform inspections.

应该可以从Node Inspector注入相同的代码,并重写Node Inspector检查来调用注入的代码,而不是使用V8调试器协议。这个变化可能不是太难,但是它仍然需要一个适当的时间。

It should be possible to inject the same code from Node Inspector and rewrite Node Inspector inspections to call the injected code instead of using the V8 debugger protocol. The change is probably not too difficult, but it still requires a decent amount of time.

如果你喜欢贡献这个功能,我很乐意为你提供帮助。请打开一个github问题来讨论实现细节。

If you like to contribute this feature, I am happy to help you. Please open a github issue to discuss implementation details.

这篇关于节点检查器可以在不暂停的情况下调试应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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