且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebug中的步骤,步骤和步骤是什么?

更新时间:2023-01-14 16:32:43


  • 转换为将导致调试器进入当前行的任何方法调用。如果有多个方法调用,它们将按执行顺序访问;如果没有方法调用,则与步骤相同。这大致等同于执行每个执行线,如解释器所见。

  • 步骤结束进入当前范围的下一行(即它会转到下一行),而不会在途中进入任何方法调用。这通常用于通过特定方法遵循逻辑而不必担心其协作者的详细信息,并且可用于查找方法中的预期条件被违反的位置。

  • 步骤 out 继续进行,直到下一个返回或等效 - 即直到控制返回到前一个堆栈帧。当您在点/方法中看到所需的所有内容时,通常会使用此方法,并且希望将堆栈冒泡几层到实际使用该值的位置。

    • Step into will cause the debugger to descend into any method calls on the current line. If there are multiple method calls, they'll be visited in order of execution; if there are no method calls, this is same as step over. This is broadly equivalent to following every individual line of execution as would be seen by the interpreter.
    • Step over proceeds to the next line in your current scope (i.e. it goes to the next line), without descending into any method calls on the way. This is generally used for following the logic through a particular method without worrying about the details of its collaborators, and can be useful for finding at what point in a method the expected conditions are violated.
    • Step out proceeds until the next "return" or equivalent - i.e. until control has returned to the preceding stack frame. This is generally used when you've seen all you need to at this point/method, and want to bubble up the stack a few layers to where the value is actually used.
    • 想象一下下面的代码,它通过 main()进入,现在位于第一行 bar

      Imagine the following code, which entered through main() and is now on the first line of bar:

function main() {
   val s = foo();
   bar(s);
}

function foo() {
   return "hi";
}

function bar(s) {
   val t = s + foo(); // Debugger is currently here
   return t;
}

然后:


  • 步入将进入 foo 调用,然后当前行将成为返回hi; foo 中的行。

  • 跳过将忽略调用另一个方法的事实,并将继续到返回t; 行(这可以让你快速查看 t 被评估为)。

  • Step out将完成剩余 bar 方法的执行,并且控件将返回 main的最后一行方法。

  • Step into will proceed into the foo call, and the current line will then become the return "hi"; line within foo.
  • Step over will ignore the fact that another method is being invoked, and will proceed to the return t; line (which lets you quickly see what t is evaluated as).
  • Step out will finish the execution of the rest of the bar method, and control will return to the last line of the main method.