I put the debugging symbols for a library into a separate file with objcopy --only-keep-debug x.so x.so.dbg strip --strip-unneeded x.so objcopy --add-gnu-debuglink="x.so.dbg" x.so This is recognized by GDB without any problems, but Heaptrack does not use the debugging symbols for such a library. If I keep them directly in the .so file everything works as expected.
Yep, the debug link support is pretty much non-existing. But if you rename the file(s) to *.debug instead of *.dbg it should work. Adding your postfix as another fallback could be added quite simply, too, as a stop-gap measure.
It actually looks like support for debug links was recently added to libbacktrace: https://github.com/gcc-mirror/gcc/commit/b919941efc58035debbcf69b645c072b7dd6ba4e I don't know what it takes to update it in Heaptrack, though.
oh, excellent - thanks for the pointer! I'll try to look at that soon and update the copy of libbacktrace. Alternatively, I still contemplate porting the code to elfutils/libdw(fl), which supports this nicely too.
Can you please try https://transfer.sh/152WHJ/heaptrack-git.3605a93-x86_64.AppImage or the wip/debuglink branch and see if it works for you? This is a build with the latest libbacktrace (and some custom patches to make it work for me).
Wow, that was a quick fix. It works perfectly for me, thank you.
Well, thanks to you to point me to the important updates in libbacktrace :)
fix landed in master now: commit 040fbf357248beb56a3cad39c512d42fd6f9ebb2 Author: Milian Wolff <milian.wolff@kdab.com> Date: Mon Nov 27 10:17:40 2017 +0100 Update libbacktrace to support compressed and separate debug info This updates the source code to libbacktrace rev trunk@255161. Additional changes on top: - keep elf_add and elf_syminfo public for use in heaptrack_interpret - check for lstat and readlink from CMake - patch the debug info code to make it work for my common use-case: * don't compare crc when not available * also get symbols from debug file BUG: 387264