]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
avoid warning about missing DW_AT_*_base in skip_DIE()
authorLuboš Luňák <l.lunak@centrum.cz>
Mon, 25 Apr 2022 20:11:27 +0000 (22:11 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 13 Jun 2022 16:12:14 +0000 (18:12 +0200)
Similarly to setup_cu_bases(), DW_FORM_addrx etc. may depend
on DW_AT_addr_base etc. that have not been read yet.

coregrind/m_debuginfo/readdwarf3.c

index 219cb6bbab6f1b7a23fc4ee77a43c172f6379980..85fc976634ce1f02316dea930d2f01e3f9dbbbd7 100644 (file)
@@ -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);