Skip to content

Commit

Permalink
backtrace.c: Add support for unwinding VFP execute instruction.
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Reichl <[email protected]>
  • Loading branch information
Timo Reichl committed Jan 2, 2017
1 parent c0f4220 commit 675de15
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions backtrace/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,32 @@ static int unwind_execute_instruction(unwind_control_block_t *ucb)
/* vps = vsp + 0x204 + (uleb128 << 2) */
ucb->vrs[13] += 0x204 + (unwind_get_next_byte(ucb) << 2);

} else if (instruction == 0xb3) {
/* pop VFP double-precision registers D[ssss]-D[ssss+cccc] */
return -1;
} else if (instruction == 0xb3 || instruction == 0xc8 || instruction == 0xc9) {
/* pop VFP double-precision registers */
vsp = (uint32_t *)ucb->vrs[13];

} else if ((instruction & 0xf8) == 0xb8) {
/* Pop VFP double precision registers D[8]-D[8+nnn] */
return -1;
/* D[ssss]-D[ssss+cccc] */
ucb->vrs[14] = *vsp++;

} else if (instruction == 0xc8) {
/* Pop VFP double precision registers D[16+sssss]-D[16+ssss+cccc] */
return -1;
if (instruction == 0xc8) {
/* D[16+sssss]-D[16+ssss+cccc] */
ucb->vrs[14] |= 1 << 16;
}

} else if (instruction == 0xc9) {
/* Pop VFP double precision registers D[sssss]-D[ssss+cccc] */
return -1;
if (instruction != 0xb3) {
/* D[sssss]-D[ssss+cccc] */
ucb->vrs[14] |= 1 << 17;
}

ucb->vrs[13] = (uint32_t)vsp;

} else if ((instruction & 0xf8) == 0xb8 || (instruction & 0xf8) == 0xd0) {
/* Pop VFP double precision registers D[8]-D[8+nnn] */
ucb->vrs[14] = 0x80 | (instruction & 0x07);

if ((instruction & 0xf8) == 0xd0) {
ucb->vrs[14] = 1 << 17;
}

} else
return -1;
Expand Down

0 comments on commit 675de15

Please sign in to comment.