Give up unwinding a fault if reading the stack fails.
This commit is contained in:
parent
091389b982
commit
9fda010b32
@ -693,6 +693,8 @@ static int cortexm_fault_unwind(struct target_s *target)
|
|||||||
/* Read stack for pre-exception registers */
|
/* Read stack for pre-exception registers */
|
||||||
uint32_t sp = spsel ? regs[REG_PSP] : regs[REG_MSP];
|
uint32_t sp = spsel ? regs[REG_PSP] : regs[REG_MSP];
|
||||||
target_mem_read_words(target, stack, sp, sizeof(stack));
|
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_LR] = stack[5]; /* restore LR to pre-exception state */
|
||||||
regs[REG_PC] = stack[6]; /* restore PC to pre-exception state */
|
regs[REG_PC] = stack[6]; /* restore PC to pre-exception state */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user