本文介绍了变量和运营商似乎分配被忽略。有什么可以做到这一点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我调试Android应用程序,我看到了加强在Eclipse中调试视图:

I am debugging an android app and I see that stepping over in eclipse debug view:

    int bottom, right;
    bottom = 800;
    right = 480;
    float h ,v;
    h = right/86.0f;
    v = bottom/116.0f;

在调试视图中的值表示,H = 86.0和v = 116.0

The values on the debug view says that h = 86.0 and v = 116.0

因此​​,这显示出正确的价值观调试器?有什么可以做到这一点?

So it's the debugger showing the right values? What can make that happen?

提示1:如果我改变文字86.0f了,说54.0f,则h = 54.0和相同的乞伏结果
提示2:这些值是正确的调试视图时,应用程序运行正常,但没有当它没有(异常捕获,应用程序的完成和SEGV_MAPERR)出现此code后不久发生的,并受使用本的H和v不正确的值。

hint 1: if I change the literal 86.0f for, say 54.0f, then h = 54.0 and the same for v
hint 2: these values are right in debug view when the app runs fine, but no when it does not (exception caught, app finishes and SEGV_MAPERR ) which appears to happen long after this code, and affected by the use of this incorrect values of h and v.

推荐答案

我不是pretty确定,但似乎我面临的Dalvik限制。打了一下,用code,A的VerifyError出现了,这使我的。减少变量数目较大我的方法和分裂他们,但问题似乎消失了。

I'm not pretty sure but it seems that i faced a Dalvik limitation. Playing a bit with the code, a VerifyError appeared, which lead me to this link. After reducing the number of variables in my larger methods and splitting them the problem seems to be gone.

这篇关于变量和运营商似乎分配被忽略。有什么可以做到这一点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 09:47