* @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 */
| 414 | * @return rt_err_t 0 is success, otherwise a failure |
| 415 | */ |
| 416 | rt_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 |
no test coverage detected