The Samba-Bugzilla – Bug 10727
can't set file:line breakpoint in ccache/clang compiled source
Last modified: 2015-08-15 14:49:16 UTC
ccache compiled code has *.i filenames instead of *.c file names so the breakpoint can't be found.
vharron-macbookpro:bp vharron$ cat bp.c
vharron-macbookpro:bp vharron$ ./build.sh
+ ccache gcc -g -o bp.o -c bp.c
+ gcc -o bp bp.o
vharron-macbookpro:bp vharron$ lldb bp
Current executable set to 'bp' (x86_64).
(lldb) b bp.c:5
Breakpoint 1: where = bp`main + 22 at bp.c:5, address = 0x0000000100000f56
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
[reply] [-] Comment 6
Removing ccache fixes this problem
filename in ccache generated symbols is incorrect?
[reply] [-] Comment 3
LLDB says a fix for this would cause significant performance regressions for the general case:
vharron-macbookpro:bp vharron$ lldb --version
lldb-310.2.37 (also reproduced with head of SVN)
vharron-macbookpro:bp vharron$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Thread model: posix
vharron-macbookpro:bp vharron$ ccache --version
ccache version 3.1.9
Copyright (C) 2002-2007 Andrew Tridgell
Copyright (C) 2009-2011 Joel Rosdahl
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
A workaround should be to build with CCACHE_CPP2=1.
> filename in ccache generated symbols is incorrect?
I would say: no. What the compiler compiled was the preprocessed .i file, not the .c file (unless CCACHE_CPP2=1 in which case the compiler compiles the original .c file instead of the intermediary .i file).
> LLDB says a fix for this would cause significant performance regressions
> for the general case: http://llvm.org/bugs/show_bug.cgi?id=20297
Not sure I understand lldb's logic here at a quick glance. Would it work if cu_sp->GetPath().c_str() was "/Users/vharron/.ccache/tmp/bp.tmp.vharron-macbookpro.roam.corp.google.com.6262.c" instead of "/Users/vharron/.ccache/tmp/bp.tmp.vharron-macbookpro.roam.corp.google.com.6262.i" or did have to be "/Users/vharron/dev/bp/bp.c" to work?
Closing due to lack of progress. Please reopen if there are any new feedback on the problem.