2
3
4
5
6
8#ifndef GIMBAL_CALL_STACK_H
9#define GIMBAL_CALL_STACK_H
11#include "../core/gimbal_result.h"
42 uint32_t sourceCurrentCaptureDepth;
51 GBL_RESULT resultCode,
52 GblSourceLocation source,
68GBL_EXPORT GBL_RESULT GblContext_memAlloc_ (GblContext* pSelf,
75GBL_EXPORT GBL_RESULT GblContext_memRealloc_ (GblContext* pSelf,
82GBL_EXPORT GBL_RESULT GblContext_memFree_ (GblContext* pSelf,
86GBL_EXPORT GBL_RESULT GblContext_logWrite_ (GblContext* pSelf,
92GBL_EXPORT GBL_RESULT GblContext_logPush_ (GblContext* pSelf,
95GBL_EXPORT GBL_RESULT GblContext_logPop_ (GblContext* pSelf,
99GBL_EXPORT GBL_RESULT GblContext_callRecordSet_ (GblContext* pSelf,
107 va_start(varArgs, pFmt);
108 pRecord
->result = GBL_RESULT_UNKNOWN;
109 pRecord->message[0] =
'\0';
111 if(pFmt)
GBL_UNLIKELY vsprintf(pRecord->message, pFmt, varArgs);
118 GBL_RESULT result = GBL_RESULT_SUCCESS;
123 if(pPrev && pPrev->pObject == pObject)
GBL_LIKELY {
124 pContext = pPrev->pContext;
131 pContext = GblThd_context(NULL);
134 pFrame->record.srcLocation.pFile =
GBL_NULL;
135 pFrame->record.srcLocation.pFunc =
GBL_NULL;
136 pFrame->record.result = initialResult;
137 pFrame->stackDepth = 0;
138 pFrame->sourceCurrentCaptureDepth = 0;
139 pFrame->pObject = pObject;
140 pFrame->pContext = pContext;
141 pFrame->pPrevFrame = NULL;
#define GBL_FORWARD_DECLARE_STRUCT(S)
uint32_t GblFlags
Standard-sized flags type, 32-bits across platforms.
Captures a result, its stringified message, and a source context.
GblSourceLocation srcLocation
Source location where the result + message had been set.
GBL_RESULT result
Result code from a previous stack frame.
GblContext * GblObject_findContext(GblObject *pSelf)
Source code context (file, function, line)
const char * pFile
Current Source file.
const char * pFunc
Current function.
size_t line
Current line of code.
Represents a single function's stack frame, from GBL_CTX_BEGIN() to GBL_CTX_END()