查找(eval:...)代码的来源 [英] Find the source of (eval:...) code

查看:119
本文介绍了查找(eval:...)代码的来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些代码可以在某个时候生成堆栈跟踪:

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?

也-这样的堆栈跟踪行是 生成的,还是可能以其他方式(send()的某些副作用?还是捕获所有方法调用的东西?)

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆