From: Julian Seward Date: Fri, 31 Aug 2007 23:08:39 +0000 (+0000) Subject: Handle DW_OP_deref in DWARF3 expressions. Fixes #147285. X-Git-Tag: svn/VALGRIND_3_3_0~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8629b74b36915a65a623ccace8161a4a1f1659bd;p=thirdparty%2Fvalgrind.git Handle DW_OP_deref in DWARF3 expressions. Fixes #147285. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6793 --- diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c index 91a1f3a454..cf2b29c15a 100644 --- a/coregrind/m_debuginfo/readdwarf.c +++ b/coregrind/m_debuginfo/readdwarf.c @@ -2111,7 +2111,7 @@ static Int copy_convert_CfiExpr_tree ( XArray* dstxa, Int srcix ) { CfiExpr* src; - Int cpL, cpR, dwreg; + Int cpL, cpR, cpA, dwreg; XArray* srcxa = srcuc->exprs; vg_assert(srcxa); vg_assert(dstxa); @@ -2122,7 +2122,10 @@ static Int copy_convert_CfiExpr_tree ( XArray* dstxa, case Cex_Undef: return ML_(CfiExpr_Undef)( dstxa ); case Cex_Deref: - return ML_(CfiExpr_Deref)( dstxa, src->Cex.Deref.ixAddr ); + cpA = copy_convert_CfiExpr_tree( dstxa, srcuc, src->Cex.Deref.ixAddr ); + if (cpA == -1) + return -1; /* propagate failure */ + return ML_(CfiExpr_Deref)( dstxa, cpA ); case Cex_Const: return ML_(CfiExpr_Const)( dstxa, src->Cex.Const.con ); case Cex_Binop: @@ -2695,11 +2698,18 @@ static Int dwarfexpr_to_dag ( UnwindContext* ctx, binop: POP( ix ); POP( ix2 ); - PUSH( ML_(CfiExpr_Binop)( dst, op, ix2, ix ) ); + PUSH( ML_(CfiExpr_Binop)( dst, op, ix2, ix ) ); if (ddump_frames) VG_(printf)("DW_OP_%s", opname); break; + case DW_OP_deref: + POP( ix ); + PUSH( ML_(CfiExpr_Deref)( dst, ix ) ); + if (ddump_frames) + VG_(printf)("DW_OP_deref"); + break; + default: if (!VG_(clo_xml)) VG_(message)(Vg_DebugMsg,