6#ifndef GIMBAL_CALL_STACK_H
7#define GIMBAL_CALL_STACK_H
9#include "../core/gimbal_typedefs.h"
25 char message[GBL_CTX_RESULT_MSG_BUFFER_SIZE];
32GBL_INLINE
GblThread* GblThread_current (
void) GBL_NOEXCEPT;
36 GblThread_stackFrameTop (
const GblThread* pSelf) GBL_NOEXCEPT;
40 va_start(varArgs, pFmt);
41 pRecord->result = GBL_RESULT_UNKNOWN;
42 pRecord->message[0] =
'\0';
43 pRecord->srcLocation.pFile = pRecord->srcLocation.pFunc = GBL_NULL;
44 if(pFmt) GBL_UNLIKELY vsnprintf(pRecord->message,
sizeof(pRecord->message), pFmt, varArgs);
46 pRecord->srcLocation = source;
47 pRecord->result = resultCode;
53 uint32_t sourceCurrentCaptureDepth;
63GBL_INLINE GBL_RESULT GBL_CTX_STACK_FRAME_CONSTRUCT(
GblStackFrame* pFrame,
GblObject* pObject, GBL_RESULT initialResult) GBL_NOEXCEPT {
64 GBL_RESULT result = GBL_RESULT_SUCCESS;
67 if(pObject) GBL_UNLIKELY {
69 if(pPrev && pPrev->pObject == pObject) GBL_LIKELY {
70 pContext = pPrev->pContext;
72 pContext = GblObject_findContext(pObject);
76 if(!pContext) GBL_LIKELY {
77 pContext = GblThread_context(NULL);
80 pFrame->record.srcLocation.pFile = GBL_NULL;
81 pFrame->record.srcLocation.pFunc = GBL_NULL;
82 pFrame->record.result = initialResult;
83 pFrame->stackDepth = 0;
84 pFrame->sourceCurrentCaptureDepth = 0;
85 pFrame->pObject = pObject;
86 pFrame->pContext = pContext;
87 pFrame->pPrevFrame = NULL;