Ruby调试正在步入而不是踩到

时间:2022-08-27 18:20:51

I am writing a Rails 4 application in Ruby 2, and I am using the debugger gem to debug my code.

我在Ruby 2中编写了一个Rails 4应用程序,我正在使用调试器gem来调试我的代码。

Here is the situation currently:

目前的情况如下:

I place a debugger statement in my Rspec tests, run the tests in the shell, and the program breaks as expected. Wishing to step to the next line, I enter n, but the debugger actually steps into the code, showing me the inner workings of libraries I don't care to see.

我在我的Rspec测试中放置一个调试器语句,在shell中运行测试,程序按预期中断。我想进入下一行,我输入n,但是调试器实际上会进入代码,向我展示我不想看到的库的内部工作原理。

So the issue is, the debugger command n is acting like s.

所以问题是,调试器命令n的作用类似于s。

How can I solve this problem*?

我怎么解决这个问题*?

*I am not willing to put a breakpoint on the next line and then continue, that will get very old, very fast.

*我不愿意在下一行放置断点然后继续,这将变得非常老,非常快。

1 个解决方案

#1


8  

Debugger does not yet fully support Ruby 2.0, and one of the issues is that next incorrectly acts like step. You’ll have to wait till the issue is fixed for it to work correctly, or use an alternative debugger such as Byebug.

调试器还没有完全支持Ruby 2.0,其中一个问题是下一个错误的行为就像步骤一样。您必须等到问题得到解决才能正常工作,或使用替代调试程序,如Byebug。

#1


8  

Debugger does not yet fully support Ruby 2.0, and one of the issues is that next incorrectly acts like step. You’ll have to wait till the issue is fixed for it to work correctly, or use an alternative debugger such as Byebug.

调试器还没有完全支持Ruby 2.0,其中一个问题是下一个错误的行为就像步骤一样。您必须等到问题得到解决才能正常工作,或使用替代调试程序,如Byebug。