crash-stack: Fix a misuse of register (workaround)
Regsiter values in struct user_regs_struct has a different layout against
its real register layout in the RISCV architecture. Especially, x0 in RISCV
means hard-wired zero register, but user_regs_struct has PC value as the
first member of it.
Since, crash-stack follows the layout of user_regs_struct, it should have
maps from original register numbers to its array indexes. The previous code
defines these maps, but there is a mistake. It does not properly map
UNW_RISCV_PC (64) to the index zero in its register value array. Because of
that, a try to get UNW_RISCV_PC causes a buffer-overflow problem.
This patch fixes this issue. But, I think that the use of register names
should be revised due to the their semantics.
Change-Id: I420da22f37e693e0bdf29debb03997d7cdd8bf29
Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
Reported-by: Seung-Woo Kim <sw0312.kim@samsung.com>