Skip to content

Commit

Permalink
core: fix print_kernel_stack()
Browse files Browse the repository at this point in the history
Previously was print_kernel_stack() supplying zeroes instead of real
values for start and size of exidx tables needed for unwind.  With this
patch are correct values for exidx and exidx_sz supplied.

Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260)
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Fixes: 31a2964 ("core: dump call stack of user TAs on abort")
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU)
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
  • Loading branch information
jenswi-linaro authored and jforissier committed Jul 6, 2017
1 parent 05348de commit e4c86a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/arch/arm/kernel/unwind_arm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*/

#include <arm.h>
#include <kernel/linker.h>
#include <kernel/misc.h>
#include <kernel/unwind.h>
#include <string.h>
Expand Down Expand Up @@ -360,6 +361,8 @@ bool unwind_stack_arm32(struct unwind_state_arm32 *state, uaddr_t exidx,
void print_kernel_stack(int level)
{
struct unwind_state_arm32 state;
uaddr_t exidx = (vaddr_t)__exidx_start;
size_t exidx_sz = (vaddr_t)__exidx_end - (vaddr_t)__exidx_start;

memset(state.registers, 0, sizeof(state.registers));
/* r7: Thumb-style frame pointer */
Expand Down Expand Up @@ -387,7 +390,7 @@ void print_kernel_stack(int level)
default:
break;
}
} while (unwind_stack_arm32(&state, 0, 0));
} while (unwind_stack_arm32(&state, exidx, exidx_sz));
}

#endif

0 comments on commit e4c86a0

Please sign in to comment.