MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_backtrace_frame

Function rt_backtrace_frame

src/kservice.c:416–433  ·  view source on GitHub ↗

* @brief Print backtrace from frame to system console device * * @param thread the thread which frame belongs to * @param frame where backtrace starts from * @return rt_err_t 0 is success, otherwise a failure */

Source from the content-addressed store, hash-verified

414 * @return rt_err_t 0 is success, otherwise a failure
415 */
416rt_weak rt_err_t rt_backtrace_frame(rt_thread_t thread, struct rt_hw_backtrace_frame *frame)
417{
418 long nesting = 0;
419
420 rt_kprintf("please use: addr2line -e rtthread.elf -a -f\n");
421
422 while (nesting < RT_BACKTRACE_LEVEL_MAX_NR)
423 {
424 rt_kprintf(" 0x%lx", (rt_ubase_t)frame->pc);
425 if (rt_hw_backtrace_frame_unwind(thread, frame))
426 {
427 break;
428 }
429 nesting++;
430 }
431 rt_kprintf("\n");
432 return RT_EOK;
433}
434
435/**
436 * @brief Print backtrace from buffer to system console

Callers 4

handle_trapFunction · 0.85
rt_hw_trap_exceptionFunction · 0.85
rt_backtraceFunction · 0.85
rt_backtrace_threadFunction · 0.85

Calls 2

rt_kprintfFunction · 0.85

Tested by

no test coverage detected