This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using libbacktrace in libgfortran: some questions
- From: Ian Lance Taylor <ian at airs dot com>
- To: FX <fxcoudert at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Thu, 13 Aug 2015 06:44:24 -0700
- Subject: Re: Using libbacktrace in libgfortran: some questions
- Authentication-results: sourceware.org; auth=none
- References: <8880A586-94DE-4745-B2BD-E07582E0F1DD at gmail dot com>
FX <fxcoudert@gmail.com> writes:
> 1. It appears that even on platforms with BACKTRACE_SUPPORTED == 0
> (such as x86_64-apple-darwin), libbacktrace is built and able to
> perform a nonsymbolic backtrace (which appears accurate). Is that a
> feature? Can I rely on it?
Yes, that is a feature. You should always get accurate PC values even
on systems where libbacktrace does not yet generate file/line
information.
> 2. The backtraces I get on x86_64-linux-gnu are missing symbols. The
> attached source file, compiled with âgfortran -gâ with the attached
> patch, gives the following backtrace with libgfortranâs existing code,
> which uses unwind and calls to addr2line:
>
>> #0 0x7F4F6E333467
>> #1 0x7F4F6E334C42
>> #2 0x7F4F6E409308
>> #3 0x4008A3 in bar at a.f90:9
>> #4 0x4008C8 in foo at a.f90:5
>> #5 0x4008AF in test at a.f90:2
>
>
> with my patch using libbacktrace, I get:
>
>> 0x7f04f00f8c7d _gfortrani_show_backtrace
>> ../../../trunk/libgfortran/runtime/backtrace.c:112
>> 0x7f04f00f9ac4 _gfortrani_sys_abort
>> ../../../trunk/libgfortran/runtime/error.c:176
>> 0x7f04f01c8c78 _gfortran_abort
>> ../../../trunk/libgfortran/intrinsics/abort.c:33
>> 0x4008a3 ???
>> /home/fx/gcc/irun/a.f90:9
>> 0x4008c8 ???
>> /home/fx/gcc/irun/a.f90:5
>> 0x4008af test
>> /home/fx/gcc/irun/a.f90:2
>> 0x4008ff main
>> /home/fx/gcc/irun/a.f90:2
>
>
> where the symbols for foo() and bar() are apparently not found, though
> the source location is. Am I missing something here? Iâm attaching the
> output of âdwarfdump a.outâ and the a.out executable file itself
> (gzipped).
I don't know why this is not working. Everything looks fine in the
a.out that you sent. Unfortunately, I think you sent the one built
without libbacktrace. Can you send me the one built with libbacktrace?
Thanks.
Ian