简体   繁体   English

在调试并逐步执行时,如何停止Xcode向我显示此汇编语言?

[英]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. 这可能是使用Release配置而不是Debug编译的代码。 It is more difficult for Xcode to relate machine instructions back to source code lines in this case. 在这种情况下,Xcode很难将机器指令与源代码行相关联。

“#line” macros also wreak havoc on compiling “ #line”宏也严重破坏了编译

Some applications use “pre-generated” (lack of a better term) source file sets, in my case “yacc”/“bison”, or “lex”/“flex”. 一些应用程序使用“预生成的”(缺少更好的术语)源文件集,在我的情况下为“ yacc” /“ bison”或“ 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 . 编译器(Xcode 6.2)接受一组参数行(根据您的应用程序定制),并将其插入到预先生成的源文件中,并生成一个中间阶段的源文件以馈入最终的源代码。

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”. 例如:我的源代码文件“ syntax.ym”用于生成中间阶段的源文件“ syntax_bison.m”。 —————— but in the mid state file it puts 2 different file names as shown below —— … code … typedef union ——————但是在中间状态文件中,它放置了两个不同的文件名,如下所示-……代码…typedef union

line 49 “syntaxer.ym” 第49行“ syntaxer.ym”

… some code … … some more code ... /* line 193 of yacc.c */ …一些代码……更多代码... / * yacc.c的第193行* /

line 849 “syntaxer_bison.m” 第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. 在进行最终编译时,这会在Xcode中的某些地方调试调试符号。

IF YOU ARE SEEING ONLY ASSEMBLY and have the “#line” within your code, comment out these lines, ie replace the “#line” with “//#line”. 如果您仅在查看汇编代码并且代码中包含“ #line”,请注释掉这些行,即用“ //#line”替换“ #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. 您仍然可以获得与原始源代码相关的信息,并且Xcode在编译时不会破坏调试信息。

USE A GLOBAL FIND and REPLACE to search for “#line” and replace with “//#line”. 使用全局查找和替换来搜索“ #line”并替换为“ //#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 ——— ——————第二个代码段的开头,带有注释行-…代码…typedef union //#第49行“ syntaxer.ym”…一些代码……更多代码... / * yacc.c的第193行* / // #line 849“ syntaxer_bison.m”…甚至还有更多代码... ———第一个代码段的结尾———

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. 编译后,调试器现在显示我的“中间阶段” c代码,除非手动选择“显示反汇编”选项,否则我看到的C或Objective C代码都没有问题。

I hope this helps Regards 希望对您有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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