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:
@ -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]));
|
||||
|
||||
Reference in New Issue
Block a user