* @brief Print backtrace of current thread to system console device * * @return rt_err_t 0 is success, otherwise a failure */
| 392 | * @return rt_err_t 0 is success, otherwise a failure |
| 393 | */ |
| 394 | rt_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 |
no test coverage detected