mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-05 05:23:46 +00:00
[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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user