Xcode调试问题 [英] Xcode debugging problem

查看:127
本文介绍了Xcode调试问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Xcode Debugger有一点问题。看起来我的步入功能不工作,因为它应该。



我可以进入任何方法调用,只要它没有返回值:

  [myObject DoSomething]; 

这个工作找到,但如果方法有一个返回值,调试器只是步骤的方法。

  double b = [myObject CalculateSomething]; 

如果我对函数而不是方法执行相同的操作,调试器总是进入函数调用。无论是否有返回值。



这是一个错误吗?这是一个功能吗?这是意味着这样吗?
我在不同的机器上尝试了当前的Xcode和Xcode 4 Beta,但是调试器拒绝使用返回值来遍历方法。



EDIT

是的,我在调试模式。我没有编译器错误,没有警告。我可以随时轻松地重现这个问题。一个方法CalculateSomething - >只做一个返回5;并且调试器不会进入它。



只有调试器拒绝使用返回值来遍历该方法或任何其他方法。

解决方案

在调试项目设置中,必须使用OPTIMIZATION_LEVEL = NONE禁用代码优化选项。



祝你好运!



资料来源:使用Xcode Build设置


I have a little problem with the Xcode Debugger. Looks to me the "Step In" function doesn't work like it should. Or just as I expect it to work.

I can step in any method call as long it has no return value:

[myObject DoSomething];

That works find but if the method has a return value, there is no Step In. the Debugger just steps over the method.

double b = [myObject CalculateSomething];

If I do the same with functions instead of methods the debugger always steps into the function call. No matter if it has a return value or not.

Is this a bug? Is it a feature? Is it meant to be that way? I tried it with the current Xcode and the Xcode 4 Beta on a different machines but the debugger refuses to step into methods with return values.

EDIT

Yes I am in debug mode. I get no compiler errors, no warnings. I can easily reproduce this problem any time. A method CalculateSomething -> just do a return 5; and the debugger will not step into it. The value is not zero afterwards, the program works fine.

Only the debugger refuses to step the method or any other method with a return value.

解决方案

In the debug project settings you must disable code optimization option with OPTIMIZATION_LEVEL = NONE.

Good luck!

Source: Working with Xcode Build Settings

这篇关于Xcode调试问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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