https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110196
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ian at gcc dot gnu.org
--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #9)
> libbacktrace is supposed to have code to do this, see fileline_initialize in
> libbacktrace/fileline.c
On linux I see fileline_initialize set filename to "/proc/self/exe" and open a
file descriptor for that, then pass the name and descriptor to
backtrace_initialize.
But I don't see the /proc/self/exe symlink being resolved by readlink, and no
filename gets stored in state->filename by backtrace_initialize. Should it be?
Or does the library try to determine the exe name again on every call to
backtrace_pcinfo?
In any case, passing a non-null filename to backtrace_create_state doesn't
change anything, because the exe name isn't what's missing here:
0# main at /tmp/trace.cc:6
1# __libc_start_call_main at :0
2# __libc_start_main@GLIBC_2.2.5 at :0
3# _start at :0
4#