lldb and include files
Bugzilla #19974

This document is a description of some of my findings related to bug 19974 and lldb’s inability to set breakpoints in an included file.

i first created two simple source files, “main1.cpp”:
int main(int argc, char const *argv[])
{
	return 0;
}

and "main4.cpp":
	#include "main1.cpp"

when i compile on the Mac with:
    clang -g -m64 -O0 -o main4.out main4.cpp

i get an object file that looks very much like the object file i get when i preprocess (at least when it comes to symbols).  both the preprocess test case and this new include test case generate object files that include main1.cpp as a symbol of type "SOL"

when i load main4.out into lldb, i can not set a breakpoint in main() with
    br set -f main1.cpp -l 3

lldb says the breakpoint has no location.  this is similar to the results i get with my preprocess test cases if the test case generates a symbol of type "SOL"

when i do a
    di -n main
lldb knows that main() is in main1.cpp because it prints out
main4.out`main at main1.cpp:2:
main4.out[0x100000f80]:  pushq  %rbp
main4.out[0x100000f81]:  movq   %rsp, %rbp
main4.out[0x100000f84]:  movl   $0x0, %eax
main4.out[0x100000f89]:  movl   $0x0, -0x4(%rbp)
main4.out[0x100000f90]:  movl   %edi, -0x8(%rbp)
main4.out[0x100000f93]:  movq   %rsi, -0x10(%rbp)
main4.out[0x100000f97]:  popq   %rbp
main4.out[0x100000f98]:  retq