|
From: <sv...@va...> - 2010-09-23 13:24:57
|
Author: sewardj
Date: 2010-09-23 14:24:48 +0100 (Thu, 23 Sep 2010)
New Revision: 11376
Log:
DW_CFA_advance_loc{,1,2,4} fail to multiply the delta by
code_alignment_factor, thereby assuming it is 1. This happens to be
OK on amd64-linux and s390x-linux because it really is 1, but on
arm-linux it is 2, and hence the boundaries between code-unwind areas
are simply wrong after any of DW_CFA_advance_loc{,1,2,4} are
processed. This patch provides the obvious fix.
Modified:
trunk/coregrind/m_debuginfo/readdwarf.c
Modified: trunk/coregrind/m_debuginfo/readdwarf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf.c 2010-09-23 11:02:48 UTC (rev 11375)
+++ trunk/coregrind/m_debuginfo/readdwarf.c 2010-09-23 13:24:48 UTC (rev 11376)
@@ -2852,6 +2852,7 @@
ctxs = &ctx->state[ctx->state_sp];
if (hi2 == DW_CFA_advance_loc) {
delta = (UInt)lo6;
+ delta *= ctx->code_a_f;
ctx->loc += delta;
if (di->ddump_frames)
VG_(printf)(" DW_CFA_advance_loc: %d to %08lx\n",
@@ -2909,6 +2910,7 @@
break;
case DW_CFA_advance_loc1:
delta = (UInt)read_UChar(&instr[i]); i+= sizeof(UChar);
+ delta *= ctx->code_a_f;
ctx->loc += delta;
if (di->ddump_frames)
VG_(printf)(" DW_CFA_advance_loc1: %d to %08lx\n",
@@ -2916,6 +2918,7 @@
break;
case DW_CFA_advance_loc2:
delta = (UInt)read_UShort(&instr[i]); i+= sizeof(UShort);
+ delta *= ctx->code_a_f;
ctx->loc += delta;
if (di->ddump_frames)
VG_(printf)(" DW_CFA_advance_loc2: %d to %08lx\n",
@@ -2923,6 +2926,7 @@
break;
case DW_CFA_advance_loc4:
delta = (UInt)read_UInt(&instr[i]); i+= sizeof(UInt);
+ delta *= ctx->code_a_f;
ctx->loc += delta;
if (di->ddump_frames)
VG_(printf)(" DW_CFA_advance_loc4: %d to %08lx\n",
@@ -3065,7 +3069,7 @@
ctxs->cfa_reg = reg;
/* ->cfa_off unchanged */
if (di->ddump_frames)
- VG_(printf)(" DW_CFA_def_cfa_reg: r%d\n", (Int)reg );
+ VG_(printf)(" DW_CFA_def_cfa_register: r%d\n", (Int)reg );
break;
case DW_CFA_def_cfa_offset:
|