查找(eval:...)代码的来源 [英] Find the source of (eval:...) code
问题描述
我有一些代码可以在某个时候生成堆栈跟踪:
I've got code which produces a stack trace at some point:
fileA.rb:1670:in `flow_completed_for'
(eval):58:in `on_success_res_for_register'
fileB:312:in `send'
fileC:312:in `request_specific_response_dispatch'
...
如何找到定义on_success_res_for_register
的源?该代码是从某个计时器调用的,我在定位功能代码时遇到问题.有什么办法可以获取该命令的源代码?
How can I find the source where on_success_res_for_register
was defined? The code is called from some timer and I have problems localising the function code. Is there any way I can get the source of that command?
也-这样的堆栈跟踪行是
Also - is such stacktrace line generated only by eval()
, or is it possible in some other way (some side effects of send()? or something catching all method calls?)
推荐答案
这意味着该方法是由eval创建的,因此它没有与之关联的文件.最好的选择就是grep表示"def flow_completed_for
".
That means the method was created by eval, so it doesn't have a file associated with it. Your best bet is just to grep for "def flow_completed_for
".
这篇关于查找(eval:...)代码的来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!