[PATCH, applying to mainline] dwarf-reader: Support creating functions from DW_TAG_inlined_subroutine DIE

Dodji Seketeli dodji@redhat.com
Fri Mar 8 17:36:26 GMT 2024


Hello,

While working on something else, I realized the recent support of
build_ir_node_from_die for DW_TAG_inlined_subroutine DIEs was triggering
an assert violation in build_function_decl.  So I am applying the patch
below to the mainline to address that.

Update the assert in build_function_decl to work on
DW_TAG_inlined_subroutine DIEs.

	* src/abg-dwarf-reader.cc (build_function_decl): Loosen the assert
	to accept DW_TAG_inlined_subroutine DIEs.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 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 2473588c..dda5507d 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -15348,7 +15348,8 @@ build_function_decl(reader&	rdr,
   function_decl_sptr result = fn;
   if (!die)
     return result;
-  ABG_ASSERT(dwarf_tag(die) == DW_TAG_subprogram);
+  int tag = dwarf_tag(die);
+  ABG_ASSERT(tag == DW_TAG_subprogram || tag == DW_TAG_inlined_subroutine);
 
   if (!die_is_public_decl(die))
     return result;
-- 
2.39.3


-- 
		Dodji



More information about the Libabigail mailing list