Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. I am able to load the project in Xcode, compile it and run it in the iPhone simulator.

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.

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".

I have installed the FireMonkey / Free Pascal / Xcode tools that came with Delphi XE2 with Update 1.

like image 200
Olaf Hess Avatar asked Oct 30 '11 10:10

Olaf Hess


1 Answers

Solution

XCode (gdb) isn't finding your source file to link to at debug time. 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.

Rebuild, and ensure that you have breakpoints turned on. XCode should say "Build and Debug", not "Build and Run".

History

I had the same problem after following Embaracedro's instructions for configuring XCode. In the Debugging window, gdb reported the error "Warning - no location found for Unit1.pas" for the break point. After changing the debugging option as indicated above, gdb reported "Resolved" for the break point, and it worked.

like image 97
Marcus Adams Avatar answered Oct 13 '22 01:10

Marcus Adams