1

I just started using Xcode to program a C++ openCV project. The project is set up with an external makefile, /usr/bin/gnumake as build tool, and the program compiles and runs fine. However, breakpoints gets skipped no matter what i do. I have tried making a new project, selecting between gdb and LLDB, restarting Xcode++ There are numerous threads about this issue, but most talk about "Load Symbols Lazily", but as far as I know, this is not an issue in Xcode 4.5.2. It is probably my limited Xcode knowledge that causes the error. Help is greatly appreciated.

Screenshot

K_scheduler
  • 101
  • 4
  • 1
    No, its not because of your limited knowledge. I have the exact same problem. None of the ideas suggested in the other breakpoint related questions solve this. Xcode just ignores my breakpoints. I have tried to reset all schemes, checked that I'm in debug mode, made sure that debug symbols are created and no code is stripped. I even deleted the user settings files within the xcode project file as suggested by Frank Szczerba in http://stackoverflow.com/questions/64790/why-arent-my-breakpoints-working-in-xcode . However it works if I create a new project... – codingFriend1 Nov 28 '12 at 15:49
  • It might however be related to having C++ code in your project, because each time this happend to me, I had C++ in my project. Yet, my breakpoints stop working without obvious reason. Everything worked fine for weeks (with C++ code, too). – codingFriend1 Nov 28 '12 at 16:04
  • @K_scheduler, check the Breakpoints button in the project window toolbar. If it's light gray, Xcode will skip the breakpoints. Click the button to make it dark gray, which tells Xcode to run your project in the debugger and stop at breakpoints. – Swift Dev Journal Nov 28 '12 at 20:22
  • Thank you, but I have checked this. – K_scheduler Nov 29 '12 at 00:21
  • Changing the debugger from LLDB to GDB in the sceme fixes this for me. LLDB will break in .m or .mm files but not in .cpp files unless I make this change. – MrMaxP May 07 '13 at 13:53

1 Answers1

2

I could resolve my similar problem by disabling "Link-Time Optimization" for the Debug build settings.

Make sure that any kind of code optimization is disabled in your debug build settings (code stripping, optimization, etc). Then check that you really run the debug build and not the release version.

It would be great if XCode could automatically warn you when you have build settings that possible break the debugger...

codingFriend1
  • 6,487
  • 6
  • 45
  • 67