Handmade Hero » Forums » Code » Xcode (lldb) debugging no breakpoints
paiv
Pavlo
2 posts
#2356 Xcode (lldb) debugging no breakpoints
2 years, 1 month ago

Apparently, Xcode (v6.1.1) ignores breakpoints inside #include'd files.
It sets breakpoints with file name and line number, but fails to understand that file is included inside another one and line numbers moved. Has anyone faced this issue?
How do you debug on OS X with unity builds?
itfrombit
Jeff Buck
28 posts
#2357 Xcode (lldb) debugging no breakpoints
2 years, 1 month ago

I ran into this too. There's an easy fix for it, but it's not obvious at all.

Create an ~/.lldbinit file and put this in it:

1
settings set target.inline-breakpoint-strategy always


See this page on the LLVM site for details:
http://lldb.llvm.org/troubleshooting.html


-Jeff
paiv
Pavlo
2 posts
#2359 Xcode (lldb) debugging no breakpoints
2 years, 1 month ago

That's exactly it. Thank you.
Jason
Jason Bricco
1 posts
#10880 Xcode (lldb) debugging no breakpoints
1 month, 2 weeks ago Edited by Jason Bricco on Feb. 13, 2017, 6:41 a.m.

Hey there,

Old thread, but I have the same problem and I can't seem to resolve it. I've been trying to follow through with the videos on a Mac but I cannot get Xcode to resolve my breakpoints. It works fine in the base cpp file, but not in any included cpp files.

I did put the "settings set target.inline-breakpoint-strategy always" in the ~/.lldbinit file but it seems to have no effect whatsoever.

If I try to run the file directly, I get told:

"line 1: settings: command not found"

It seems it doesn't even understand the line at all. I have no experience with LLDB nor this file and don't know how it is used or read. Maybe that's just because it has to be called by LLDB instead of directly?

What could I be missing here?

Additional Info:

-To use Xcode as a debugger, I created an empty Xcode project, made a new scheme, and set the run executable to my executable and checked the 'debug executable' option. Then I linked it to my code folder so my code appears in Xcode, and set breakpoints by clicking in the gutter.
-I built with debug mode (generating debug information).
-Everything works fine using LLDB from the terminal, but doesn't work through Xcode.

Thanks for any help!