| 169 | } |
| 170 | |
| 171 | void |
| 172 | db_trace_self(void) |
| 173 | { |
| 174 | struct unwind_state state; |
| 175 | uint32_t sp; |
| 176 | |
| 177 | /* Read the stack pointer */ |
| 178 | __asm __volatile("mov %0, sp" : "=&r" (sp)); |
| 179 | |
| 180 | state.registers[FP] = (uint32_t)__builtin_frame_address(0); |
| 181 | state.registers[SP] = sp; |
| 182 | state.registers[LR] = (uint32_t)__builtin_return_address(0); |
| 183 | state.registers[PC] = (uint32_t)db_trace_self; |
| 184 | |
| 185 | db_stack_trace_cmd(&state); |
| 186 | } |
no test coverage detected