public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] Bug 29829 - dwarf-reader: Allow DIEs to be in a lexical block
Date: Fri, 02 Dec 2022 17:16:24 +0100	[thread overview]
Message-ID: <87y1rpsrvr.fsf@redhat.com> (raw)

Hello,

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>
Applied to the master branch.
---
 src/abg-dwarf-reader.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index e18f111b..68a4ca35 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -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
-- 
2.31.1


-- 
		Dodji


                 reply	other threads:[~2022-12-02 16:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1rpsrvr.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).