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

Function rt_backtrace

src/kservice.c:394–407  ·  view source on GitHub ↗

* @brief Print backtrace of current thread to system console device * * @return rt_err_t 0 is success, otherwise a failure */

Source from the content-addressed store, hash-verified

392 * @return rt_err_t 0 is success, otherwise a failure
393 */
394rt_weak rt_err_t rt_backtrace(void)
395{
396 struct rt_hw_backtrace_frame frame;
397 rt_thread_t thread = rt_thread_self();
398
399 RT_HW_BACKTRACE_FRAME_GET_SELF(&frame);
400 if (!frame.fp)
401 return -RT_EINVAL;
402
403 /* we don't want this frame to be printed which is nearly garbage info */
404 rt_hw_backtrace_frame_unwind(thread, &frame);
405
406 return rt_backtrace_frame(thread, &frame);
407}
408
409/**
410 * @brief Print backtrace from frame to system console device

Callers 8

cmd_backtraceFunction · 0.70
rt_assert_handlerFunction · 0.70
rt_exit_critical_safeFunction · 0.70
rt_exit_critical_safeFunction · 0.70
_mutex_take_safeFunction · 0.50
lwp_mutex_release_safeFunction · 0.50
_reportFunction · 0.50
assert_handlerFunction · 0.50

Calls 3

rt_thread_selfFunction · 0.85
rt_backtrace_frameFunction · 0.85

Tested by

no test coverage detected