&是什么QUOT;由于当前方法的代码进行了优化&QUOT无法计算表达式;意思? [英] What does "Cannot evaluate expression because the code of the current method is optimized." mean?

查看:277
本文介绍了&是什么QUOT;由于当前方法的代码进行了优化&QUOT无法计算表达式;意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一些代码有很多递归的,这需要相当长的时间才能完成。每当我暂停运行来看看这是怎么回事,我得到:





因为无法计算表达式当前方法的代码进行了优化。





我想我明白这意味着什么。然而,令我百思不解的是,我打步骤后,代码是不是优化了,我可以看看我的变量。这是如何发生的呢?如何可以将代码来回翻动优化,非optimzed代码之间?


解决方案

调试器使用FuncEval,让你看的变量。 FuncEval需要在托管代码在GarbageCollector安全点停止线程。手动暂停在IDE中运行导致所有线程尽快停止。你的高度递归代码往往会停在一个不安全的点。因此,调试器无法计算表达式。



按下F10键移动到下一个Funceval安全点,将使功能评价。



有关更多信息,审查FuncEval 的规则


I wrote some code with a lot of recursion, that takes quite a bit of time to complete. Whenever I "pause" the run to look at what's going on I get:

Cannot evaluate expression because the code of the current method is optimized.

I think I understand what that means. However, what puzzles me is that after I hit step, the code is not "optimized" anymore, and I can look at my variables. How does this happen? How can the code flip back and forth between optimized and non-optimzed code?

解决方案

The Debugger uses FuncEval to allow you to "look at" variables. FuncEval requires threads to be stopped in managed code at a GarbageCollector safe point. Manually "pausing" the run in the IDE causes all threads to stop as soon as possible. Your highly recursive code will tend to stop at an unsafe point. Hence, the debugger is unable to evaluate expressions.

Pressing F10 will move to the next Funceval Safe point and will enable function evaluation.

For further information review the rules of FuncEval.

这篇关于&是什么QUOT;由于当前方法的代码进行了优化&QUOT无法计算表达式;意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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