简体   繁体   English

如何在Xcode中调试Delphi iOS FireMonkey应用程序?

[英]How to debug a Delphi iOS FireMonkey application in Xcode?

I am trying to debug a FireMonkey application compiled with Delphi XE2 with Update 1 using Xcode v3.2.6 on Apple Snow Leopard 10.6.8. 我正在尝试使用Apple Snow Leopard 10.6.8上的Xcode v3.2.6调试使用Delphi XE2和Update 1编译的FireMonkey应用程序。 I am able to load the project in Xcode, compile it and run it in the iPhone simulator. 我能够在Xcode中加载项目,编译它并在iPhone模拟器中运行它。

However, debugging does not seem to work. 但是,调试似乎不起作用。 When I launch the project using "Run / Debug - Breakpoints On", all breakpoints in the Pascal source file which I had set in Xcode are ignored and the IDE does not interrupt the program when the code gets executed. 当我使用“Run / Debug - Breakpoints On”启动项目时,我在Xcode中设置的Pascal源文件中的所有断点都被忽略,并且IDE在代码执行时不会中断程序。

I have created a "Debug" configuration and in the "Deployment" options deselected the entries "Strip Debug Symbols During Code" and "Strip Linked Product". 我创建了一个“调试”配置,并在“部署”选项中取消选择条目“在代码中删除调试符号”和“剥离链接产品”。 In the "Build Options" "DWARF with dSYM File" is selected as the "Debug Information Format". 在“构建选项”中,选择“带有dSYM文件的DWARF”作为“调试信息格式”。

I have installed the FireMonkey / Free Pascal / Xcode tools that came with Delphi XE2 with Update 1. 我安装了带有Update 1的Delphi XE2附带的FireMonkey / Free Pascal / Xcode工具。

Solution

XCode (gdb) isn't finding your source file to link to at debug time. XCode(gdb)在调试时未找到要链接的源文件。 You can help it. 你可以帮忙。

In XCode, click on the application menu and select Preferences, in the Debugging preferences clear the checkbox "Load symbols lazily" and click OK. 在XCode中,单击应用程序菜单并选择“首选项”,在“调试”首选项中清除“懒惰加载符号”复选框,然后单击“确定”。

Rebuild, and ensure that you have breakpoints turned on. 重建,并确保您已打开断点。 XCode should say "Build and Debug", not "Build and Run". XCode应该说“构建和调试”,而不是“构建和运行”。

History 历史

I had the same problem after following Embaracedro's instructions for configuring XCode. 按照Embaracedro的配置XCode的说明后,我遇到了同样的问题。 In the Debugging window, gdb reported the error "Warning - no location found for Unit1.pas" for the break point. 在调试窗口中,gdb报告了断点的错误“警告 - 找不到Unit1.pas的位置”。 After changing the debugging option as indicated above, gdb reported "Resolved" for the break point, and it worked. 在更改了如上所示的调试选项后,gdb报告了断点的“已解决”,并且它有效。

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

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