Xcode breakpoints not hit in Juce source code

Has anyone else found that if breakpoints are set in the Juce source code then they’re never hit? Breakpoints work fine in my application code, and I can step into Juce source code from my application code, but Xcode refuses hit any breakpoint set directly in the Juce source.

I’m using an Introjucer generated project (set not to copy modules locally) and I’m running in debug. Debug symbols were enabled in Introjucer.

Could it be that the Xcode debugger doesn’t like the inclusion of .cpp files from other cpps? Or just another day with Apple’s persistently and shockingly God-awful joy-sucking tools?

I’m using Xcode 4.6 - this happens with iOS and Mac projects.

Hey, what would you know, shortly after posting I decided to change the debugger from LLDB to GDB and the breakpoints now work.

So it’s looking like the one about the God-awful tools then.

Wow — great catch…I’m trying to run the basic PluginHost to try to understand how it does VST loading so as to try and replicate an obscure crash in Max 6 related to loading VST plugins. Spent the last two hours trying to figure out why I couldn’t set breakpoints.

Thank you!

I’ve just about had it with Xcode. I mainly use it on iOS, where if you’re lucky you can step your code about 10 times before it hangs and getting the value of variables is a lottery, even in debug. Don’t know if it’s any better when debugging OS X apps.

I thought there was no alternative but someone on the Apple forums put me onto AppCode, which I’ve yet to get the time to evaluate. It’s fully compatible with Xcode projects, and if it works better then it’ll be well worth spending the $$$ if it increases productivity and causes my hair to go grey at a slower rate.

I haven’t heard of AppCode, I’ll have to check it out.

My other problem with xcode is that the debugger isn’t showing me the values in the objects in the JUCE code. At least it wasn’t before I switched back to GDB, I haven’t had a chance to check again. However, I’d like to understand WHY LLDB doesn’t work, it’s supposed to be very good.

I was on the iOS forums asking about this recently because it’s been driving me crazy. I wasn’t ranting, more just wanting to ask others if they were experiencing similar problems since I was finding it hard to believe that such a flaky bit of software could be released - I thought I must be doing something wrong since I wouldn’t let software in this apparent state go out of the door, let alone a company the size of Apple! I can literally encounter one serious bug for every 5 minutes I use it.

The consensus was generally one of agreement - it often hangs after stepping a dozen lines, and frequently won’t show the callstack or variables even in debug. Coders who could work cross-platform were doing their debugging work in VS, or resorting to printf’s and/or static code inspection where that wasn’t possible. Some thought that LLDB was a little better, others GDB - but they both seem quite frankly crap.

These days it doesn’t seem to crash much, and the UI (although not to my tastes) and the build settings/dependencies are fairly robust. Code browsing’s pathetic (“Couldn’t find symbol” - it’s bloody right there you Xcode FOOL!). The debugger in the last version of 3.x actually seemed the most reliable for me, and then it went downhill with Xcode 4. In early versions of 4, disassembly went missing, then for one version (4.2 maybe?) I spent several months working on a complex iOS app with no callstack at all, and then on the next version the callstack was back but I had the problems listed above.

Fortunately I can mainly work in Visual Studio which seems top notch these days, and I even have a Surface RT build now so I can do all my ARM assembler on that too. If I had to work with Xcode all day I’d go feral and be unable to integrate myself with the rest of society. Definitely going to try AppCode soon!

Check out the Nougat beta from Rem Objects (runs under Visual Studio). You can write in “Pascal” and work with the Objective-C frameworks directly on Mac and iOS.

------ If I had to work with Xcode all day

This comment saved me from a lot of grief. Thanks!

Apparently it has to do with the “unity” style of including cpp files. I found a fix on StackOverflow:

From StackOverflow:

Link to the page: http://stackoverflow.com/a/17693317/683614

1 Like

Amazing! Works like a charm. Thanks so much for finding that out!

Hey good find. Nice of them to ‘default’ it to not working :slight_smile:


I have the same problem. But none of the two tricks work for me.

I am using XCode 5.1 Has anyone made it work?

It works for me with XCode 5.1.1

I have a list of things to check when it doesn't work: 



1 Like

Just wanted to add another possible cause of breakpoints not working that I just found out (xcode 7).

The breakpoints were working in my main code, and in all the juce sources, but NOT in my module.
This was because in my module’s main .cpp and .h files, I was including some files this way :

#include "./math/MyGreatFunctions.h"
#include "./math/MyGreatFunctions.cpp"

changing it too :

#include "math/MyGreatFunctions.h"
#include "math/MyGreatFunctions.cpp"

solved everything!

Is that a confirmed problem. For example, if you change it back do they stop working again?? :slight_smile: And what version of Xcode … I may add it to my list. It’s a very popular article that one…

Yes, if I change it back they stop working again immediately!
I’m on xcode 7.3.1. I haven’t checked yet, but I suspect it will also fix some issue I had with the profiler (not being able to find the sources)

I’m seeing this issue with the plugin demos available in JUCE v5.2.0. For example, in the audio plugin demo, I set up breakpoints in the PluginProcessor.cpp file using Xcode 9.2, but Xcode jumps right over them. Breakpoints work fine for my other Xcode projects; it’s only the JUCE plugin demos that have the issue.

I’ve tried to fix the problem using the suggested solutions in the link below, but nothing works. Am I missing something?

To solve my issue, I just followed the steps below:

  1. In Xcode, go to Product–> Scheme–> Edit Scheme…
  2. Select the “Run” tab on the left.
  3. Under the “Info” section, select the executable corresponding to your Xcode project. For example, if your Xcode project is called “AudioFilter”, choose the “AudioFilter.app” option from the Executable dropdown menu.
  4. Make sure “Debug executable” is checked.