From: Luboš Luňák Date: Tue, 26 Apr 2022 06:35:16 +0000 (+0200) Subject: treat DW_TAG_skeleton_unit like DW_TAG_compile_unit X-Git-Tag: VALGRIND_3_20_0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e95904b99c87606eae1372ee4661e9db03833f08;p=thirdparty%2Fvalgrind.git treat DW_TAG_skeleton_unit like DW_TAG_compile_unit It's basically the same, except for being split-dwarf. Handling it is required e.g. for reading line info. --- diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c index e50d5d46d7..79d6764eaf 100644 --- a/coregrind/m_debuginfo/readdwarf.c +++ b/coregrind/m_debuginfo/readdwarf.c @@ -1136,7 +1136,8 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui, tag = step_leb128U( &abbrev_img ); - if ( tag != 0x0011 /*TAG_compile_unit*/ ) + if ( tag != 0x0011 /*TAG_compile_unit*/ + && tag != 0x004a /*TAG_skeleton_unit*/ ) return; /* Not a compile unit (might be partial) or broken DWARF. */ /* DW_CHILDREN_yes or DW_CHILDREN_no */ @@ -1330,7 +1331,8 @@ void read_unitinfo_dwarf2( /*OUT*/UnitInfo* ui, } /* Now store the members we need in the UnitInfo structure */ - if ( tag == 0x0011 /*TAG_compile_unit*/ ) { + if ( tag == 0x0011 /*TAG_compile_unit*/ + || tag == 0x004a /*TAG_skeleton_unit*/ ) { if ( name == 0x03 ) ui->name = sval; /* DW_AT_name */ else if ( name == 0x1b ) ui->compdir = sval; /* DW_AT_compdir */ else if ( name == 0x10 ) ui->stmt_list = cval; /* DW_AT_stmt_list */ diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index e9aab0dd52..86af340ebc 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -2826,7 +2826,8 @@ static void parse_var_DIE ( if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_type_unit - || dtag == DW_TAG_partial_unit) { + || dtag == DW_TAG_partial_unit + || dtag == DW_TAG_skeleton_unit) { Bool have_lo = False; Bool have_hi1 = False; Bool hiIsRelative = False; @@ -3467,7 +3468,8 @@ static Bool parse_inl_DIE ( /* Get info about DW_TAG_compile_unit and DW_TAG_partial_unit which in theory could also contain inlined fn calls, if they cover an address range. */ Bool unit_has_addrs = False; - if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_partial_unit) { + if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_partial_unit + || dtag == DW_TAG_skeleton_unit) { Bool have_lo = False; Addr ip_lo = 0; const HChar *compdir = NULL; @@ -3859,7 +3861,8 @@ static void parse_type_DIE ( /*MOD*/XArray* /* of TyEnt */ tyents, if (dtag == DW_TAG_compile_unit || dtag == DW_TAG_type_unit - || dtag == DW_TAG_partial_unit) { + || dtag == DW_TAG_partial_unit + || dtag == DW_TAG_skeleton_unit) { if (level == 0) setup_cu_bases(cc, c_die, abbv); /* See if we can find DW_AT_language, since it is important for