Xcode Debugger: Why does this only show me assembler?

I am just starting out with developing Cocoa in xcode, making an example of hello world. I will go to step 6 of the " debug runtime " section, which

Using the "Step by Step" button on the debugger toolbar, start executing the code. As you execute each line of code, you can check the status of the programs. The value of a variable is sometimes painted in red to indicate that the value has been changed in the last step. Note that the debugger pauses until the specified line is executed. After each pause, you can add additional breakpoints or select Debug> Restart to terminate the application and start a new debugging session.

now what I am pulling out my hair in the last hour is the fact that this debugger will only show assembly code. I can manually select the source file, but as soon as I click "Step over", I will return to the assembler. I can’t understand for life how to turn off the assembler and show it my source code!

+41
debugging xcode cocoa
Sep 14 '09 at 11:53
source share
3 answers

I know this article turned one hundred years old, but if someone asks how to solve this problem in later versions of Xcode (unlike Xcode 3), you will find the corresponding option indicated by Always Show Disassembly in the Debug> Debug Workflow section in Xcode 6 and above. Make sure the option is NOT checked.

In Xcode 5, the option was marked as "Show disassembly when debugging" in Debug> Debug workflow . Make sure that the "Show disassembly during debugging" checkbox is not selected.

Back in Xcode 4, the option "Show disassembly during debugging" was found under Product> Debug Workflow . Again, make sure the option is not set.

It drove me crazy too.

NOTE. The information above is still valid for Xcode 9+. I applied updates to this answer when new versions of Xcode were released. Fortunately, the option has remained unchanged since Xcode 6 (for now).

+104
Sep 04 2018-11-11T00:
source share

There are two more things to make sure:

  • What are you looking at one of your own functions / methods. If the stack frame you are looking at is a function or method from one of the frameworks, you will see the assembly no matter how you configure Xcode.
  • What are you using build Debug. Separate the debugging symbols (as in the Release assembly), and you will look at the assembly even for your own code, no matter what.
+10
Sep 14 '09 at 12:33
source share

I really figured it out before I sent the message, but I wanted to save other potential future headaches (as well as if I forget later), because I could not find the answer to this question by going to the stack overflow, but I found that I am not alone.

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

+1
Sep 14 '09 at 11:56
source share



All Articles