]> sourceware.org Git - libabigail.git/commitdiff
Bug 29829 - dwarf-reader: Allow DIEs to be in a lexical block libabigail-2.2
authorDodji Seketeli <dodji@redhat.com>
Fri, 2 Dec 2022 15:59:13 +0000 (15:59 +0000)
committerDodji Seketeli <dodji@redhat.com>
Fri, 2 Dec 2022 16:13:13 +0000 (17:13 +0100)
Normally, ABI-relevant DWARF DIEs (types and decls) should be at
namespace level.  There are real-life cases where such a DIE might be
defined in a lexical block.

This patch teaches the DWARF reader to handle such cases.

* src/abg-dwarf-reader.cc (get_scope_for_die): Support
DW_TAG_lexical_block as DIE scope.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc

index e18f111b6f8e1b4f3fb45fb291b0a47c6ff2f665..68a4ca35174ea9bf6a0d571e225bb5e7003ce582 100644 (file)
@@ -11632,7 +11632,8 @@ get_scope_for_die(reader& rdr,
   scope_decl_sptr s;
   type_or_decl_base_sptr d;
   if (dwarf_tag(&parent_die) == DW_TAG_subprogram
-      || dwarf_tag(&parent_die) == DW_TAG_array_type)
+      || dwarf_tag(&parent_die) == DW_TAG_array_type
+      || dwarf_tag(&parent_die) == DW_TAG_lexical_block)
     // this is an entity defined in a scope that is a function.
     // Normally, I would say that this should be dropped.  But I have
     // seen a case where a typedef DIE needed by a function parameter
This page took 0.04272 seconds and 5 git commands to generate.