The patch allows asan symbolize script to use separate debug info files on Linux system using ELF debug link or build ID for debug info files locating. These are methods provided currently by GNU Binutils. Added functionality replicates the GDB algorithm https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
Diff Detail
Event Timeline
Why can't you use llvm-symbolizer? This tool implements searching for separate debug info files (looking at /usr/lib/debug, calculating crc32 hashes and so on). I was sure that addr2line does this as well. This should be the responsibility of the tools we invoke through asan_symbolize.py script, not the script itself.
I am using gcc and GNU binutils, not llvm. You are right, the separate debug info is supported by addr2line tool. But I need it to work with sysroot defined also. The other way could be to add such functionality to addr2line instead of patching the script.
So if you don't find the patch generally useful I agree it must be rejected.
I think the functionality is generally useful, but it's the responsibility of the individual tools (binutils and LLVM equivalents) to handle standalone debug, not every script or tool that invokes them.
lib/asan/scripts/asan_symbolize.py | ||
---|---|---|
596 | Standalone debug works the same way on FreeBSD too, so == 'Linux' is too restrictive. |
I think that adding support for standalone debug info to asan_symbolize.py is not an option. This logic is already implemented in the symbolization tools, if you want them to work with custom sysroot (so that debug versions of binaries could be found at /path/to/my/sysroot/usr/lib/debug), just add the --sysroot flag to the tools. I can review and submit this kind of patch to llvm-symbolizer tool.
Standalone debug works the same way on FreeBSD too, so == 'Linux' is too restrictive.