openocd: arm read pc -> offset of 8

On ARM we need to add a offset to the pc, if we read it
(ARM ARM (DDI 0100I) page A2-9). This fixes bugs in memory
trace generation and watchpoint recognition.

Change-Id: I1cfcb84af2abae7971869d2ce29d602648e2f020
This commit is contained in:
Lars Rademacher
2013-12-31 16:12:37 +01:00
parent 83ac40dfb5
commit 9f334a02bd

View File

@ -442,6 +442,7 @@ int main(int argc, char *argv[])
continue;
}
oocdw_read_reg(i, &(regs.r[i]));
regs.r[15] += 8;
}
// ABT SPSR is usr cpsr
@ -1280,6 +1281,9 @@ static bool getMemAccess(uint32_t opcode, struct halt_condition *access) {
for (int i = 0; i < 16; i++) {
if ((1 << i) & op.regs_r) {
oocdw_read_reg(i, &(regs.r[i]));
if (i == 15) {
regs.r[15] += 8;
}
}
if ((i >= 10) && ((1 << i) & op.regs_r_fiq)) {
oocdw_read_reg(i - 10 + fail::RI_R10_FIQ, &(regs.r[i]));