简体   繁体   中英

How do I stop Xcode from showing me this assembly language when I'm debugging and step over?

在此处输入图片说明

I have "Show Disassembly" unchecked, but after a few step overs this still shows up.

This might be code that was compiled with the Release configuration rather than Debug. It is more difficult for Xcode to relate machine instructions back to source code lines in this case.

“#line” macros also wreak havoc on compiling

Some applications use “pre-generated” (lack of a better term) source file sets, in my case “yacc”/“bison”, or “lex”/“flex”. The compiler (Xcode 6.2) takes a sets of parametric lines (customizing to your app) and plugs them into a pre-generated source file and generates a mid-stage source file to feed into your final source code .

When it does this, it adds in line numbers that relate the “mid-stage” source code lines back to your original source code lines for debugging.

Unfortunately it screws it up.
For example: My source code file “syntax.ym” is used to generate a mid-stage source file “syntax_bison.m”. —————— but in the mid state file it puts 2 different file names as shown below —— … code … typedef union

line 49 “syntaxer.ym”

… some code … … some more code ... /* line 193 of yacc.c */

line 849 “syntaxer_bison.m”

… some more code ... ——— end of 1st snippet ———

This SCREWS UP THE DEBUG SYMBOLS some where within Xcode when doing the final compile.

IF YOU ARE SEEING ONLY ASSEMBLY and have the “#line” within your code, comment out these lines, ie replace the “#line” with “//#line”. You'll still have the information for you to relate back to your original source code, and Xcode doesn't screw up the debugging information when compiling.

USE A GLOBAL FIND and REPLACE to search for “#line” and replace with “//#line”.

my source when modified looks as follows

—————— begin of 2nd snippet, with lines commented —— … code … typedef union // #line 49 “syntaxer.ym” … some code … … some more code ... /* line 193 of yacc.c */ // #line 849 “syntaxer_bison.m” … even more code ... ——— end of 1st snippet ———

After compiling the debugger now shows my “mid-stage” c code and unless I manually select the “show disassembly” option, I see my C or Objective C code with no problems.

I hope this helps Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM