]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
readdwarf3.c (parse_inl_DIE) inlined_subroutine can appear in namespaces
authorMark Wielaard <mark@klomp.org>
Mon, 22 Nov 2021 12:07:59 +0000 (13:07 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 22 Nov 2021 12:15:36 +0000 (13:15 +0100)
This was broken by commit 75e3ef0f3 "readdwarf3: Skip units without
addresses when looking for inlined functions". Specifically by this
part: "Also use skip_DIE instead of read_DIE when not parsing
(skipping) children"

rustc puts concrete function instances in namespaces (which is
allowed in DWARF since there is no strict separation between type
declarations and program scope entries in a DIE tree), the inline
parser didn't expect this and so skipped any DIE under a namespace
entry. This wasn't an issue before because "skipping" a DIE tree was
done by reading it, so it wasn't actually skipped. But now that we
really skip the DIE (sub)tree (which is faster than actually parsing
it) some entries were missed in the rustc case.

https://bugs.kde.org/show_bug.cgi?id=445668

NEWS
coregrind/m_debuginfo/readdwarf3.c

diff --git a/NEWS b/NEWS
index 567f19daa85040a8a18fc3ce02d642e7b425efcf..76e598fb7faac226f8a9113f391d05f7c0be94a9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -53,6 +53,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 445300  [PATCH] Fix building tests with Musl
 445354  arm64 backend: incorrect code emitted for doubleword CAS
 445415  arm64 front end: alignment checks missing for atomic instructions
+445668  Inline stack frame generation is broken for Rust binaries
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index 18eecea9f311f6918fe1c43208295d2c023dde40..5489f8d135c3b71ce74921380e24750e2ee43510 100644 (file)
@@ -3358,7 +3358,7 @@ static Bool parse_inl_DIE (
    // might maybe contain a DW_TAG_inlined_subroutine:
    Bool ret = (unit_has_addrs
                || dtag == DW_TAG_lexical_block || dtag == DW_TAG_subprogram
-               || dtag == DW_TAG_inlined_subroutine);
+               || dtag == DW_TAG_inlined_subroutine || dtag == DW_TAG_namespace);
    return ret;
 
   bad_DIE: