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

Function unwind_backtrace

libcpu/arm/cortex-a/backtrace.c:482–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482void unwind_backtrace(struct pt_regs *regs, const struct unwind_idx exidx_start[], const struct unwind_idx exidx_end[])
483{
484 struct stackframe frame;
485 const struct unwind_idx *origin_idx = RT_NULL;
486
487 LOG_D("%s(regs = %x)", __func__, regs);
488
489 arm_get_current_stackframe(regs, &frame);
490
491#ifndef RT_BACKTRACE_FUNCTION_NAME
492 rt_kprintf("please use: addr2line -e rtthread.elf -a -f %08x\n", frame.pc);
493#endif
494 LOG_D("pc = %08x, sp = %08x", frame.pc, frame.sp);
495
496 while (1)
497 {
498 int urc;
499
500 urc = unwind_frame(&frame, &origin_idx, exidx_start, exidx_end);
501 if (urc < 0)
502 break;
503 //dump_backtrace_entry(where, frame.pc, frame.sp - 4);
504#ifndef RT_BACKTRACE_FUNCTION_NAME
505 rt_kprintf(" %08x", frame.pc);
506#endif
507 LOG_D("from: pc = %08x, frame = %08x", frame.pc, frame.sp - 4);
508 }
509 rt_kprintf("\n");
510}
511
512extern const struct unwind_idx __exidx_start[];
513extern const struct unwind_idx __exidx_end[];

Callers 1

rt_unwindFunction · 0.70

Calls 3

rt_kprintfFunction · 0.85
unwind_frameFunction · 0.70

Tested by

no test coverage detected