我有一行带有重载方法的 Ruby 代码。我想显示该行的调用堆栈。我不知道caller
or的位置byebug
。我想在执行后显示该行的当前调用堆栈并找到调试的地方。我该怎么做?
大约像caller Test.method
,然后:
from /var/lib/gems/2.3.0/gems/railties-4.2.3/lib/rails/commands/console.rb:110:in `start'
from /var/lib/gems/2.3.0/gems/railties-4.2.3/lib/rails/commands/console.rb:9:in `start'
from /var/lib/gems/2.3.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:68:in `console'
from /var/lib/gems/2.3.0/gems/railties-4.2.3/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /var/lib/gems/2.3.0/gems/railties-4.2.3/lib/rails/commands.rb:17:in `<top (required)>'