clang -g -fsanitize=address produces broken debug info?

Clang can produce .debug_aranges? Somebody asked me about this recently, and I couldn’t get clang to produce a non-empty section, unless I was compiling an assembler source.


Exactly, we don't produce it at the moment. It's on the list mind you, but ...


When I compile with -fsanitize=address the resulting binary contains a
.debug_aranges section on Linux. However it is incomplete and it trips
up lldb.

Do you have an example? A random testcase didn't have anything emitted.


This appears to be fixed ToT. Must have been fixed very recently? The
last build I did was last week. You can also reproduce with clang-3.3.

Hi Eric,

I am still seeing this issue actually. Last night I built clang with clang to save time. I just figured out this issue is only visible if you build clang with gcc/g++.

I am on Debian Wheezy and LLVM was configured with:

cmake $LLVMSrcDir

See below for more info.



I don't have one handy, but my guess is that it's not building the
compiler with gcc that's the issue - it's that you have .o files
linked in that have debug information with aranges in there. I imagine
you wouldn't see the aranges in the file if you did:

clang -g -fsanitize=address main.c -c

and then looked at main.o before linking.