Xcode debugging problem
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
I haven't seen this problem on Xcode 3.2.3.
However, I have seen cases where the debugger gets confused about methods called against objects returned by imbedded methods e.g.
id myResult=[[self returnAnObject] tellObjectToDoSomething];
Sometimes the debugger doesn't seem to know which method to drop into or it "forgets" that there are two method calls on the line.
If you have customize accessors, you may always drop into the the accessor instead of the outer method (i.e.tellObjectToDoSomething
.)
Turn off code optimization. In Build Settings, change:
To:
精彩评论