[lldb-dev] sharing code between lldb and AddressSanitizer

Greg Clayton gclayton at apple.com
Mon Mar 26 10:22:20 PDT 2012


Dmitry,

Can you attach an example ELF file with DWARF and the main.cpp source file to the bug so that I can take a look? "-pie" is not a valid argument for our current darwin clang++, so this might be a linux specific compiler driver option.

Greg

On Mar 26, 2012, at 2:16 AM, Dmitry Vyukov wrote:

> On Wed, Feb 29, 2012 at 12:50 PM, Dmitry Vyukov <dvyukov at google.com> wrote:
> On Tue, Feb 28, 2012 at 10:25 PM, Greg Clayton <gclayton at apple.com> wrote:
> > Ironically the symbolizer works great on gcc-compiled binaries,
> > but fails on clang-compiled binaries.
> > It provides some info but it's dead wrong (point into some
> > random STL source files).
> > objdump -dlS shows
> > correct info for the binaries, and I guess you mostly work with
> > clang-compiled binaries.
> > So are there any known problems? What may I be missing?
> 
> Not that we know of. Clang binaries work great on MacOSX and symbolicate just fine. If you have any quick examples where address lookups fail, please send me examples off the list.
> 
> 
> I've tracked down the problem.
> When I build the lookup example as
> $ clang++ main.cpp -I../../include -llldb -g -frtti
> It works.
> However when I build it as:
> $ clang++ main.cpp -I../../include -llldb -g -frtti -fPIE -pie
> It fails to symbolize itself. While objdump -dSl symbolizes it (shows line numbers inside of functions). If I build a program with gcc with -fPIE -pie, it also able to symbolize itself (with lldb).
> So, the problem seems to be in tricky interaction of clang, lldb and -pie.
> It's all Linux/amd64 and tip clang.
> 
> 
> Ping. Any progress on this? It's critical for us, we build everything only with -pie, so this thing renders lldb useless for us. I've filed an issue:
> http://llvm.org/bugs/show_bug.cgi?id=12355
> 




More information about the lldb-dev mailing list