| 253 | |
| 254 | #if BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE |
| 255 | uint32_t getCallStack(uint32_t _skip, uint32_t _max, uintptr_t* _outStack) |
| 256 | { |
| 257 | const uint32_t max = _skip+_max+1; |
| 258 | void** tmp = (void**)BX_STACK_ALLOC(sizeof(uintptr_t)*max); |
| 259 | |
| 260 | const uint32_t numFull = backtrace(tmp, max); |
| 261 | const uint32_t skip = min(_skip + 1 /* skip self */, numFull); |
| 262 | const uint32_t num = numFull - skip; |
| 263 | |
| 264 | memCopy(_outStack, tmp + skip, sizeof(uintptr_t)*num); |
| 265 | |
| 266 | return num; |
| 267 | } |
| 268 | |
| 269 | struct StackTraceContext |
| 270 | { |
no test coverage detected