Xcode 7 debugger does not break in inline header f

2019-07-18 04:16发布

问题:

I have been using Xcode with various C++ projects for the last five years without this issue. Today, I opened one of my older projects (~2 years old) and tried to debug an inline function in a header file by placing an active breakpoint within that function. For some reason, the debugger will not break on this code. However, if I put a breakpoint in the .cpp file where this function is called, I can step into and through each line of the function. I then noticed that this is happening for all (inline) functions defined in header files.

I have never had this problem before. I have other, similar, projects that do not exhibit this behaviour - breakpoints work everywhere.

I believe that Xcode uses LLDB as the debugger - where would I start looking for a project setting that might cause this?

I have no relevant compiler warnings when building.

I may have "updated to recommended settings" when opening the old project in the newer Xcode - this may have changed something related, although I'm not sure what. I have updated other projects and not had this problem happen.

I am using Xcode 7 on El Capitan.

回答1:

Got it working! finally, this Apple Developer Thread contained the solution: set manually the breakpoint from the debugger prompt:

(lldb) br s --file framework.ipp --line 577 

breaks as expected, while setting the breakpoint from Xcode (using 8.3, but had the same problem with 4, 5, 6 and 7) in this location does not work. I tried many other solutions, and none of them did the job.