| 308 | } |
| 309 | |
| 310 | BX_NO_INLINE uint32_t getCallStackExecInfoBacktrace(uint32_t _skip, uint32_t _max, uintptr_t* _outStack) |
| 311 | { |
| 312 | #if BX_CONFIG_CALLSTACK_USE_EXECINFO |
| 313 | const uint32_t max = _skip+_max+1; |
| 314 | uintptr_t* tmp = (uintptr_t*)BX_STACK_ALLOC(sizeof(uintptr_t)*max); |
| 315 | |
| 316 | const uint32_t numFull = backtrace( (void**)tmp, max); |
| 317 | const uint32_t skip = min(_skip + 1 /* skip self */, numFull); |
| 318 | const uint32_t num = numFull - skip; |
| 319 | |
| 320 | memCopy(_outStack, tmp + skip, sizeof(uintptr_t)*num); |
| 321 | |
| 322 | return num; |
| 323 | #else |
| 324 | BX_UNUSED(_skip, _max, _outStack); |
| 325 | return 0; |
| 326 | #endif // BX_CONFIG_CALLSTACK_USE_EXECINFO |
| 327 | } |
| 328 | |
| 329 | static const uintptr_t* nextStackFrame(const uintptr_t* _stackFrame) |
| 330 | { |
no test coverage detected