bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/29573] addr2line doesn't display file/line for c++ variabl


From: cvs-commit at gcc dot gnu.org
Subject: [Bug binutils/29573] addr2line doesn't display file/line for c++ variables
Date: Wed, 21 Sep 2022 06:42:07 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29573

--- Comment #9 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3094c89e9ce3ae656ac56147ee34bf1f65e63d04

commit 3094c89e9ce3ae656ac56147ee34bf1f65e63d04
Author: Alan Modra <amodra@gmail.com>
Date:   Wed Sep 21 14:54:49 2022 +0930

    PR29573, addr2line doesn't display file/line for local symbols

    The DWARF standard is clear that DW_AT_linkage_name is optional.
    Compilers may not provide the attribute on functions and variables,
    even though the language mangles names.  g++ does not for local
    variables and functions.  Without DW_AT_linkage_name, mangled object
    file symbols can't be directly matched against the source-level
    DW_AT_name in DWARF info.  One possibility is demangling the object
    file symbols, but that comes with its own set of problems:
    1) A demangler might not be available for the compiler/language.
    2) Demangling doesn't give the source function name as stored in
       DW_AT_name.  Class and template parameters must be stripped at
       least.

    So this patch takes a simpler approach.  A symbol matches DWARF info
    if the DWARF address matches the symbol address, and if the symbol
    name contains the DWARF name as a sub-string.  Very likely the name
    matching is entirely superfluous.

            PR 29573
            * dwarf.c (lookup_symbol_in_function_table): Match a symbol
            containing the DWARF source name as a substring.
            (lookup_symbol_in_variable_table): Likewise.
            (_bfd_dwarf2_find_nearest_line_with_alt): If stash_find_line_fast
            returns false, fall back to comp_unit_find_line.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]