为什么明显缺乏“下一个”? Firebug 的 JavaScript 调试器中的选项?

发布于 2024-11-17 05:25:32 字数 512 浏览 1 评论 0原文

似乎 JavaScript 调试器缺少一个非常基本的功能:Next。

“Next”(就像 PDB 中的 Python 调试器)应该执行当前行并停止。看起来很基本。

现在也许我完全遗漏了一些东西(这就是我问的原因),但我理解现有命令的工作原理如下:

Step Into:下降到当前函数的主体

Step Over:执行当前函数,无需下降

Step Out :移回堆栈

继续:继续运行直到下一个断点

我的阅读显示“单步执行”应该等同于“下一步”,但它似乎并非如此。我只想执行该行,无需降序、升序,或者必须在我所在的行之后立即设置另一个断点。我非常习惯在 PDB 中输入“nnnnn n”来逐行执行代码。 Firebug 似乎缺少这个...或者缺少它;-)

最后,我还觉得“上一个”或“后一个”应该可用。有了最左边一列中那个诱人的“播放头”,如果能够拖动它并在运行时执行代码行,那就太好了。我可以做梦。

对此的任何澄清都会有所帮助。

Seems that the JavaScript debugger is lacking a very basic feature: Next.

"Next" (like in PDB the Python debugger) should execute the current line and stop. Seems pretty basic.

Now maybe I'm completely missing something (which is why I ask), but I understand the existing commands to work as follows:

Step Into: descend into the body of current function

Step Over: execute the current function w/o descending

Step Out: move back up the stack

Resume: continue running until the next breakpoint

My reading shows that Step Over should be equivalent to "Next" but it doesn't appear to be. I just want to execute the line, w/o descending, ascending, or having to set another breakpoint imemdiately after the line I'm on. I'm very accustomed to type "n n n n n n" in PDB to step through code line by line. Firebug seems to be missing this...or I'm missing it ;-)

Finally, I also feel that "previous" or "back" should be available. With that enticing "playhead" in the leftmost column, it would be great to be able to drag that thing around, executing the line of code as it goes. I can dream.

Any clarification on this would be helpful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

茶花眉 2024-11-24 05:25:32

“跳过”功能并不意味着“跳过下一行”。它意味着执行它,但如果它包含函数调用,则将语句本身视为工作单元。换句话说,“结束”只是意味着“不要进入任何涉及的功能”。

根据我的经验,“前一个”或“后一个”功能只能由极其复杂的调试器或本质上非常有利于此类事情的语言提供。像 Firebug 这样的东西几乎肯定会因为浏览器现实的本质而无法实际实现这些功能。考虑一下备份从 DOM 中删除元素的语句意味着什么。 Firebug 必须要求浏览器归还它,我敢打赌,没有办法做到这一点(至少在 Firebug 变得比现在更加巨大和昂贵的情况下是不可能的:-)

The "Step over" function does not mean, "skip the next line". It means to execute it, but should it contain a function call, to treat the statement itself as the unit of work. In other words, the "over" just means, "don't step into any functions involved".

In my experience "previous" or "back" are the kinds of features that can only really be supplied by either an extremely sophisticated debugger, or else for languages that are by nature very conducive to such things. Something like Firebug is almost certainly barred by the nature of browser reality from actually implementing those. Consider what it would mean to back up over a statement that removed an element from the DOM. Firebug would have to ask the browser to give it back, and I'd bet money that there's just no way to do that (at least not without Firebug becoming even more gigantic and expensive than it already is :-)

享受孤独 2024-11-24 05:25:32

我猜您的意思是您不想多次单击“跳过”按钮以移至下一行。您需要一个可以直接将您移至下一行的按钮。没有“下一步”按钮,但您可以使用上下文菜单中的“运行到此行”命令。

有一些研究工具可以让你向后移动,但它们仍然不实用。

I guess you mean that you don't want to click on the "Step Over" button several times to move to the next line. You need a button that directly move you to the next line. There is no "Next" button but you can use "Run to this Line" command in the context menu.

There are some research tools which let you to move backwards but they are not still practical.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文