Message ID | 20180606065838.30364-1-rashmica.g@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | libpdbg: Attempt to restore registers that we clobbered on failure | expand |
diff --git a/libpdbg/chip.c b/libpdbg/chip.c index 6d0b47e..f35d783 100644 --- a/libpdbg/chip.c +++ b/libpdbg/chip.c @@ -266,9 +266,13 @@ static int ram_instructions(struct pdbg_target *thread_target, uint64_t *opcodes } if (thread->ram_instruction(thread, opcode, &scratch)) { - PR_DEBUG("%s: %d\n", __FUNCTION__, __LINE__); + PR_DEBUG("%s: %d, %lx\n", __FUNCTION__, __LINE__, opcode); exception = 1; - break; + if (i >= 0 || i < len) + /* skip the rest and attempt to restore r0 and r1 */ + i = len - 1; + else + break; } if (i == -2)