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

Message ID 87ttlg4odh.fsf@redhat.com
State New
Headers
Series [applying,to,mainline] dwarf-reader: Support creating functions from DW_TAG_inlined_subroutine DIE |

Commit Message

Dodji Seketeli March 8, 2024, 5:36 p.m. UTC
  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(-)
  

Patch

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;