MCPcopy Create free account
hub / github.com/crownengine/crown / getCallStackWinAbi

Function getCallStackWinAbi

3rdparty/bx/src/debug.cpp:510–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508 }
509
510 BX_NO_INLINE uint32_t getCallStackWinAbi(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
511 {
512 if (BX_ENABLED(BX_PLATFORM_WINDOWS && BX_CPU_X86 && BX_ARCH_32BIT) )
513 {
514 const uintptr_t* stackFrame = (uintptr_t*)&_skip - 2;
515
516 uint32_t num = 0;
517
518 while (NULL != stackFrame
519 && num < _max)
520 {
521 if (uintptr_t(0) == stackFrame[1])
522 {
523 break;
524 }
525
526 if (BX_UNLIKELY(0 < _skip) )
527 {
528 --_skip;
529 }
530 else
531 {
532 _outStack[num++] = stackFrame[1];
533 }
534
535 stackFrame = nextStackFrame(stackFrame);
536 }
537
538 return num;
539 }
540 else if (BX_ENABLED(BX_PLATFORM_WINDOWS && BX_CPU_X86 && BX_ARCH_64BIT) )
541 {
542 return getCallStackWinRtl(_skip + 1 /* skip self */, _max, _outStack);
543 }
544
545 return 0;
546 }
547
548 BX_NO_INLINE uint32_t getCallStackFast(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
549 {

Callers 1

getCallStackFastFunction · 0.85

Calls 2

nextStackFrameFunction · 0.85
getCallStackWinRtlFunction · 0.85

Tested by

no test coverage detected