Fix the unwinder to get past functions with no stack but may cause an

exception. In this case no registers will be updated but the link register
will be copied to the program counter to be used to find the calling
function. In this case the program counter may be updated and we should
continue with the trace.
This commit is contained in:
Andrew Turner 2014-12-21 21:38:12 +00:00
parent ec7d251e09
commit c18b81e54b

View File

@ -345,9 +345,16 @@ db_unwind_tab(struct unwind_state *state)
/* /*
* The program counter was not updated, load it from the link register. * The program counter was not updated, load it from the link register.
*/ */
if (state->registers[PC] == 0) if (state->registers[PC] == 0) {
state->registers[PC] = state->registers[LR]; state->registers[PC] = state->registers[LR];
/*
* If the program counter changed, flag it in the update mask.
*/
if (state->start_pc != state->registers[PC])
state->update_mask |= 1 << PC;
}
return 0; return 0;
} }