Search code examples
c++iosxcodexcode4breakpoints

Xcode: breakpoints in the C++ headers files seems to be ignored


I'm running in Xcode 4.3.3 an iOS project with some C++ classes.

When I run it in debug mode the breakpoints in the C++ headers files seem to be ignored. For example, the barcode on the third line of this code doesn't work:

    class myClass : public Reader {
    private:
        static const int INTEGER_MATH_SHIFT = 8;

I'm expecting the code to break on the constant assignment, or am I wrong ? Thanks


Solution

  • A breakpoint can only be set on executable code. The initialization of an object with static lifetime with a constant expression doesn't generate any executable code (and while you mention assignment, there's no assignment in the code you've posted). In fact, in the special case of a constant of integral type, it's likely that the object doesn't exist at all unless you take its address.