arch: riscv: stacktrace: use current thread if `thread` is NULL
Zephyr's thread stack size is not fixed, in most cases we would
need the `thread` argument to obtain the `stack_info`, unless
we are unwinding the irq stack, since that is fixed.
Otherwise we can only safely print the current `mepc` register,
unwinding the esf without the stack info of a thread can
result in undefined behavior.
Signed-off-by:
Yong Cong Sin <ycsin@meta.com>
Loading
Please sign in to comment