Blame SOURCES/valgrind-3.18.1-demangle-namespace.patch

6e98bf
commit 542447d4708d4418a08e678dcf467af92b90b7ad
6e98bf
Author: Mark Wielaard <mark@klomp.org>
6e98bf
Date:   Mon Nov 22 13:07:59 2021 +0100
6e98bf
6e98bf
    readdwarf3.c (parse_inl_DIE) inlined_subroutine can appear in namespaces
6e98bf
    
6e98bf
    This was broken by commit 75e3ef0f3 "readdwarf3: Skip units without
6e98bf
    addresses when looking for inlined functions". Specifically by this
6e98bf
    part: "Also use skip_DIE instead of read_DIE when not parsing
6e98bf
    (skipping) children"
6e98bf
    
6e98bf
    rustc puts concrete function instances in namespaces (which is
6e98bf
    allowed in DWARF since there is no strict separation between type
6e98bf
    declarations and program scope entries in a DIE tree), the inline
6e98bf
    parser didn't expect this and so skipped any DIE under a namespace
6e98bf
    entry. This wasn't an issue before because "skipping" a DIE tree was
6e98bf
    done by reading it, so it wasn't actually skipped. But now that we
6e98bf
    really skip the DIE (sub)tree (which is faster than actually parsing
6e98bf
    it) some entries were missed in the rustc case.
6e98bf
    
6e98bf
    https://bugs.kde.org/show_bug.cgi?id=445668
6e98bf
6e98bf
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
6e98bf
index 18eecea9f..5489f8d13 100644
6e98bf
--- a/coregrind/m_debuginfo/readdwarf3.c
6e98bf
+++ b/coregrind/m_debuginfo/readdwarf3.c
6e98bf
@@ -3358,7 +3358,7 @@ static Bool parse_inl_DIE (
6e98bf
    // might maybe contain a DW_TAG_inlined_subroutine:
6e98bf
    Bool ret = (unit_has_addrs
6e98bf
                || dtag == DW_TAG_lexical_block || dtag == DW_TAG_subprogram
6e98bf
-               || dtag == DW_TAG_inlined_subroutine);
6e98bf
+               || dtag == DW_TAG_inlined_subroutine || dtag == DW_TAG_namespace);
6e98bf
    return ret;
6e98bf
 
6e98bf
   bad_DIE: