1

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.

1
  • Dou you build in debug mode? Have you declared that method before? Any compiler warnings? Any output on the console? If I'd have to guess, b is zero after the call? Commented Aug 26, 2010 at 12:44

3 Answers 3

4

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

Good luck!

Source: Working with Xcode Build Settings

Sign up to request clarification or add additional context in comments.

1 Comment

Source link out of date. Is this what you linked? developer.apple.com/library/ios/recipes/…
0

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.)

Comments

0

Turn off code optimization. In Build Settings, change:

enter image description here To:

enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.