From: Luboš Luňák Date: Mon, 25 Apr 2022 20:11:27 +0000 (+0200) Subject: avoid warning about missing DW_AT_*_base in skip_DIE() X-Git-Tag: VALGRIND_3_20_0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=383f36462fdc25a0e849391cf845e22703a95c08;p=thirdparty%2Fvalgrind.git avoid warning about missing DW_AT_*_base in skip_DIE() Similarly to setup_cu_bases(), DW_FORM_addrx etc. may depend on DW_AT_addr_base etc. that have not been read yet. --- diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index 219cb6bbab..85fc976634 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -1899,8 +1899,15 @@ void skip_DIE (UWord *sibling, *sibling = cts.u.val; nf_i++; } else if (abbv->nf[nf_i].skip_szB == VARSZ_FORM) { - get_Form_contents( &cts, cc, c_die, False /*td3*/, - &abbv->nf[nf_i] ); + DW_FORM form = abbv->nf[nf_i].at_form; + if(form == DW_FORM_addrx || form == DW_FORM_strx + || form == DW_FORM_rnglistx || form == DW_FORM_loclistx) { + /* Skip without interpreting them, they may depend on e.g. + DW_AT_addr_base that has not been read yet. */ + (void) get_ULEB128(c_die); + } else + get_Form_contents( &cts, cc, c_die, False /*td3*/, + &abbv->nf[nf_i] ); nf_i++; } else { advance_position_of_Cursor (c_die, (ULong)abbv->nf[nf_i].skip_szB);