From c18b81e54b2a5ceaaaba183ce44df9e7d3efbe5b Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Sun, 21 Dec 2014 21:38:12 +0000 Subject: [PATCH] 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. --- sys/arm/arm/db_trace.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/db_trace.c b/sys/arm/arm/db_trace.c index e0d755266853..0f06486c9d12 100644 --- a/sys/arm/arm/db_trace.c +++ b/sys/arm/arm/db_trace.c @@ -345,9 +345,16 @@ db_unwind_tab(struct unwind_state *state) /* * 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]; + /* + * 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; }