什么是“由于当前方法的代码被优化而无法评估表达式”。意思? [英] What does "Cannot evaluate expression because the code of the current method is optimized." mean?

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

问题描述

我写了一些代码与大量的递归,需要相当多的时间来完成。每当我暂停运行以查看发生了什么,我得到:

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?

推荐答案

Debugger使用FuncEval允许看看变量。 FuncEval需要在GarbageCollector安全点处的托管代码中停止线程。手动暂停IDE中的运行会导致所有线程尽快停止。您的高度递归代码将倾向于停止在不安全的点。因此,调试器无法计算表达式。

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.

按F10将移至下一个Funceval Safe点,并启用函数求值。

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

有关详情,请参阅规则of FuncEval

这篇关于什么是“由于当前方法的代码被优化而无法评估表达式”。意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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