Re: [PATCH] riscv/stacktrace: fix stackframe without ra on the top

2020-11-27 Thread Kefeng Wang
On 2020/11/27 16:45, Chen Huang wrote: When a function doesn't have a callee, then it will not push ra into the stack, such as lkdtm_BUG() function: addisp,sp,-16 sd s0,8(sp) addis0,sp,16 ebreak Then we use pt_regs as a parameter to walk_stackframe(), for the struct stackframe us

[PATCH] riscv/stacktrace: fix stackframe without ra on the top

2020-11-27 Thread Chen Huang
When a function doesn't have a callee, then it will not push ra into the stack, such as lkdtm_BUG() function: addisp,sp,-16 sd s0,8(sp) addis0,sp,16 ebreak Then we use pt_regs as a parameter to walk_stackframe(), for the struct stackframe use {fp,ra} to get information from stack, it