[kservice] Enhance support for backtrace service (#9037)

[feat] Enhance support for backtrace service

rt_backtrace_formatted_print() and rt_backtrace_to_buffer() to help
debug routines.

Also, following modification are included:
- make rt_backtrace_frame patchable with weak attr
- replace lwp backtrace with sync output

Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
Shell
2024-06-13 08:55:53 +08:00
committed by GitHub
parent 1869c543a6
commit e5b7f3fdd8
6 changed files with 174 additions and 33 deletions

View File

@@ -370,7 +370,7 @@ void rt_hw_trap_exception(struct rt_hw_exp_stack *regs)
#endif
struct rt_hw_backtrace_frame frame = {.fp = regs->x29, .pc = regs->pc};
rt_backtrace_frame(&frame);
rt_backtrace_frame(rt_thread_self(), &frame);
rt_hw_cpu_shutdown();
}

View File

@@ -366,7 +366,7 @@ void handle_trap(rt_size_t scause, rt_size_t stval, rt_size_t sepc, struct rt_hw
.pc = sepc
};
rt_kprintf("fp = %p", frame.fp);
rt_backtrace_frame(&frame);
rt_backtrace_frame(rt_thread_self(), &frame);
RT_ASSERT(0);
}