13

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.

Olaf Hess
  • 1,453
  • 11
  • 18
  • No idea, but good question (well explained and you've already tried to solve it with things that make sense. That is not true for all new users here :p) Upvoted, and welcome to Stack Overflow! – David Oct 30 '11 at 23:23
  • Not a real solution, but after installing Xcode v4.0.2 I was able to use the integrated debugger. Marcus' answer provided the necessary information to make it work in v3.2.6 as well. – Olaf Hess Nov 01 '11 at 07:44

1 Answers1

3

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.

Marcus Adams
  • 53,009
  • 9
  • 91
  • 143
  • Thanks, that did the trick. To turn off the setting "Load symbols lazily" in Xcode 3.2.6 one has to open "Preferences" from the "Xcode" menu and select the "Debugging" tab. – Olaf Hess Nov 01 '11 at 07:41