Search code examples
xcodebreakpoints

Xcode 4.6 / 5 with lldb breakpoints not working


I had a problem with using debugger LLDB,

if in "main.c" , I include another file like "a.c" , and set breakpoint in "a.c" the breakpoint will never been stopped.

Is anyone else getting this?

ok, here is the example

// main.c
#include "a.c"
int main()
{
    test();
}


// a.c
void test()
{
    return; // (Using UI to)set break point here, the gdb will stop, and lldb will not
}

======================================================================

To trojanfoe: I had tried these steps in Xcode 4.6.3 command line utilities, the result is like yours, but my problem is on GUI,

When I use the mouse to set a break point on "a.c", it will not work.

I had tried to stop on main(), and enter this cmd "br list", here is the message on console,

(lldb) br list
Current breakpoints:
1: file ='a.c', line = 13, locations = 0 (pending)


2: file ='main.c', line = 15, locations = 1, resolved = 1

  2.1: where = test`main + 15 at main.c:15, address = 0x0000000100000f3f, resolved, hit count = 1 

(lldb) 

if you need the log by using command line utilities, please tell me, thanks~


Solution

  • See "File and line breakpoints are not getting hit" in http://lldb.llvm.org/troubleshooting.html - that seems to be talking about exactly your build scenario, and I've just had this problem. To solve it I not only had to put this in $HOME/.lldbinit:

    settings set target.inline-breakpoint-strategy always

    I also had to do a clobber (distclean) build and restart Xcode.