views:

493

answers:

3

I'm just starting out with Cocoa development in xcode, doing the hello world example. I'm up to step 6 of the section "runtime debugging", which is

Using the Step Over button in the debugger toolbar, begin stepping through the code. As each line of code executes, you can examine the program’s state. The value of a variable is sometimes drawn in red to indicate that the value was modified in the last step. Notice that the debugger pauses before executing the indicated line. After each pause, you can add additional breakpoints or choose Debug > Restart to terminate the application and start a new debugging session.

now what I've been pulling my hair out for over the last hour is the fact that this debugger will only show me assembly code. I can manually select my source code file, but as soon as I click "Step over" I'm right back in assembler view. I can't for the life of me figure out how to turn the assembler off, and make it show me my source code!

+1  A: 

I actually figured this out before I posted, but I wanted to save others potential future headaches, (and also in case I forget later) as I could not find the answer to this by searching stack overflow, but I did find that I'm not alone.

From the run menu, select "Debugger Display" > "Source Only", or "Debugger Display" > "Source and Disassembly"

Breton
+3  A: 

There are two other things to make sure of:

  1. That you're looking at one of your own functions/methods. If the stack frame you're looking at is a function or method from one of the frameworks, you're going to see assembly no matter how you have Xcode configured.
  2. That you are running a Debug build. Strip debug symbols (as in a Release build), and you'll be looking at assembly even for your own code, no matter what.
Peter Hosey
A: 

Make sure your folder name is in English

crean
What does that have to do with whether the debugger shows assembly?
Peter Hosey