https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67696

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ccoutant at gmail dot com,
                   |                            |ian at airs dot com,
                   |                            |jason at gcc dot gnu.org,
                   |                            |pault at gcc dot gnu.org,
                   |                            |vries at gcc dot gnu.org

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
The fact that the error showed up both with libbacktrace and gdb suggest that
the debug information is wrong.

It would have been good to see the DW_TAG_subprogram DIE for foo (using readelf
-w), with the DW_AT_name and DW_AT_linkage_name attributes. This could have
confirmed that the generated debug info was incorrect.

Either way, with trunk I see:
...
 <2><126>: Abbrev Number: 5 (DW_TAG_subprogram)
    <127>   DW_AT_external    : 1
    <127>   DW_AT_name        : (indirect string, offset: 0x31a): cp__b
    <12b>   DW_AT_decl_file   : 1
    <12c>   DW_AT_decl_line   : 3
    <12d>   DW_AT_linkage_name: (indirect string, offset: 0x310):
__foo_MOD_cp__b
    <131>   DW_AT_low_pc      : 0x400632
    <139>   DW_AT_high_pc     : 0xe    
    <141>   DW_AT_frame_base  : 1 byte block: 9c        (DW_OP_call_frame_cfa)
    <143>   DW_AT_GNU_all_tail_call_sites: 1
...

and:
...
Program aborted. Backtrace:
#0  0x40063f in __foo_MOD_cp__b
        at /data/gcc_versions/devel/test2.f90:4
#1  0x400648 in test
        at /data/gcc_versions/devel/test2.f90:10
#2  0x40067f in main
        at /data/gcc_versions/devel/test2.f90:9
...

So, libbacktrace prints the DW_AT_linkage_name, as is the documented behaviour.

Both the DW_AT_name and DW_AT_linkage name do not contain the 'cp(bool)'
reported in comment 0.

Propose to mark this resolved-fixed.

Reply via email to