Give up unwinding a fault if reading the stack fails.

This commit is contained in:
Gareth McMullin 2014-09-12 12:24:43 +12:00
parent 091389b982
commit 9fda010b32
1 changed files with 2 additions and 0 deletions

View File

@ -693,6 +693,8 @@ static int cortexm_fault_unwind(struct target_s *target)
/* Read stack for pre-exception registers */
uint32_t sp = spsel ? regs[REG_PSP] : regs[REG_MSP];
target_mem_read_words(target, stack, sp, sizeof(stack));
if (target_check_error(target))
return 0;
regs[REG_LR] = stack[5]; /* restore LR to pre-exception state */
regs[REG_PC] = stack[6]; /* restore PC to pre-exception state */